• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ouwiki_display_wiki_parameters函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ouwiki_display_wiki_parameters函数的典型用法代码示例。如果您正苦于以下问题:PHP ouwiki_display_wiki_parameters函数的具体用法?PHP ouwiki_display_wiki_parameters怎么用?PHP ouwiki_display_wiki_parameters使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: ouwiki_display_page_in_index

function ouwiki_display_page_in_index($indexitem, $subwiki, $cm)
{
    if ($startpage = is_null($indexitem->title)) {
        $title = get_string('startpage', 'ouwiki');
        $output = '<div class="ouw_index_startpage">';
    } else {
        $title = $indexitem->title;
        $output = '';
    }
    $output .= '<a class="ouw_title" href="view.php?' . ouwiki_display_wiki_parameters($indexitem->title, $subwiki, $cm) . '">' . htmlspecialchars($title) . '</a>';
    $lastchange = new StdClass();
    $lastchange->userlink = ouwiki_display_user($indexitem, $cm->course);
    $lastchange->date = ouwiki_recent_span($indexitem->timecreated) . ouwiki_nice_date($indexitem->timecreated) . '</span>';
    $output .= '<div class="ouw_indexinfo">';
    $output .= ' <span class="ouw_lastchange">' . get_string('lastchange', 'ouwiki', $lastchange) . '</span>';
    $output .= '</div>';
    if ($startpage) {
        $output .= '</div>';
    }
    return $output;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:21,代码来源:wikiindex.php


示例2: dirname

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Import page content from other ouwiki activities into this wiki.
 * @package mod
 * @subpackage ouwiki
 * @copyright 2013 The Open University
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once dirname(__FILE__) . '/../../config.php';
require $CFG->dirroot . '/mod/ouwiki/basicpage.php';
require $CFG->dirroot . '/mod/ouwiki/import_form.php';
$pageparams = ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_ARRAY);
/* Define/work out the step of the import process we are on.
 Step 1  - Select wiki (+sub wiki)
Step 2 - Select pages
Step 3 - Confirm
Step 4 - Process import
*/
$curstep = optional_param('step', 1, PARAM_INT);
if (optional_param('cancel', '', PARAM_TEXT) == get_string('cancel')) {
    // Cancelled last step, go back one.
    $curstep -= 2;
}
$pageparams['step'] = $curstep;
$url = new moodle_url('/mod/ouwiki/import.php', array('id' => $id, 'page' => $pagename));
$PAGE->set_url($url);
$PAGE->set_cm($cm);
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:import.php


示例3: reportsuser_usercommentstable

/**
 * Print the table which list the comments by the user in this subwiki,
 *  with the date of the comment and a link to the page
 *
 * @param unknown_type $subwiki   the subwiki in question
 * @param unknown_type $cm
 * @param unknown_type $userid    the id of the user
 * @param unknown_type $header    the header text for the table
 */
function reportsuser_usercommentstable($subwiki, $cm, $userid, $header, $csv)
{
    // get the user comments info
    $usercomments = ouwiki_get_usercomments($subwiki->id, $userid);
    if (count($usercomments) == 0) {
        return;
    }
    // Print the opening div and table tags as well as the header row
    if (!$csv) {
        print <<<EOF
<div class="ouw_usercommentslist">
 \t<h3>{$header->comments}</h3>
\t<table>
\t\t<tr>
\t\t\t<th class='ouw_leftcol' scope="col">{$header->datetime}</th>
\t\t\t<th class='ouw_rightcol' scope="col">{$header->pagename}</th>\t\t\t
\t\t</tr>\t\t
EOF;
    } else {
        print $csv->line() . $csv->quote($header->comments) . $csv->line() . $csv->quote($header->datetime) . $csv->sep() . $csv->quote($header->pagename) . $csv->line();
    }
    // for each comment in this subwiki by the user
    foreach ($usercomments as $usercomment) {
        // get the date and time of the comment
        $datetime = ouwiki_nice_date($usercomment->timeposted);
        // get the page title of the page with the comment
        $title = $usercomment->title;
        // make it html safe
        $pagetitle = htmlspecialchars($title);
        // create html link to the page
        $pagelink = "<a href='view.php?" . ouwiki_display_wiki_parameters($title, $subwiki, $cm) . "'>{$pagetitle}</a>";
        // if title is blank then must be subwiki start page - create link to there
        if ($title == '') {
            $pagelink = "<a href='view.php?" . ouwiki_display_wiki_parameters(null, $subwiki, $cm) . "'>" . get_string('startpage', 'ouwiki') . "</a>";
        }
        // print the table row for date and time and page link for comments by user
        if (!$csv) {
            print <<<EOF
\t\t<tr>
\t\t\t<td class='ouw_leftcol'>{$datetime}</td>
\t\t\t<td class='ouw_rightcol'>{$pagelink}</td>\t
\t\t</tr>\t\t
EOF;
        } else {
            if ($title == '') {
                $title = get_string('startpage', 'ouwiki');
            }
            print $csv->quote($datetime) . $csv->sep() . $csv->quote($title) . $csv->line();
        }
    }
    // close table and div tags
    if (!$csv) {
        print '
	</table>
</div>';
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:66,代码来源:reportsuser.php


示例4: foreach

// don't get confused
if ($candelete) {
    $found = false;
    foreach ($comments as $comment) {
        if ($comment->deleted) {
            $found = true;
            break;
        }
    }
    if ($found) {
        print '<p class="ouw_deletedcommentinfo">' . get_string('commentdeletedinfo', 'ouwiki') . '</p>';
    }
}
print '<div class="ouwiki_allcomments">';
// OK, display all comments
print ouwiki_display_comments($comments, $section, $pagename, $subwiki, $cm, true, $candelete);
// And 'add comment' form
if ($canpost) {
    print '<h2>' . get_string('commentpostheader', 'ouwiki') . '</h2>';
    print '<a id="post"></a>';
    print ouwiki_display_comment_form('comments', $section, $section ? $knownsections[$section] : null, $pagename, $subwiki, $cm);
}
print '</div>';
// Link to return to page
global $CFG, $THEME;
print '<div class="ouw_returnlink">' . '<span class="sep">' . $THEME->larrow . '</span> ' . '<a href="view.php?' . ouwiki_display_wiki_parameters($pageversion->title, $subwiki, $cm) . '">' . get_string('returntopage', 'ouwiki') . '</a></div>';
// Footer
ouwiki_print_footer($course, $cm, $subwiki, $pagename);
?>

开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:29,代码来源:comments.php


示例5: get_record

// Check permission
$comment = get_record('ouwiki_comments', 'id', $commentid);
$candelete = has_capability('mod/ouwiki:deletecomments', $context);
global $USER;
$owncomment = $comment->userid == $USER->id;
if (!$owncomment && !$candelete) {
    error('You do not have permission to delete this comment');
}
$confirmed = optional_param('confirm', 0, PARAM_INT);
// Admin users don't have to confirm delete since they can undelete
if ($candelete || $confirmed) {
    // Delete comment
    ouwiki_delete_comment($pageversion->pageid, $commentid, $delete);
    // Redirect
    redirect($url);
} else {
    // Display confirm form
    $nav = get_string('commentdelete', 'ouwiki');
    ouwiki_print_start($ouwiki, $cm, $course, $subwiki, $pagename, $context, array(array('name' => $nav, 'type' => 'ouwiki')), true, true);
    print_box_start();
    print '<p>' . get_string('commentdeleteconfirm', 'ouwiki') . '</p>';
    print '<form action="deletecomment.php" method="post">';
    print ouwiki_display_wiki_parameters($pageversion->title, $subwiki, $cm, OUWIKI_PARAMS_FORM);
    print '<input type="hidden" name="sesskey" value="' . sesskey() . '" />' . '<input type="hidden" name="comment" value="' . $commentid . '" />' . '<input type="hidden" name="section" value="' . $section . '" />' . '<input type="hidden" name="delete" value="' . $delete . '" />' . '<input type="hidden" name="confirm" value="1" />' . '<input type="submit" name="action" value="' . get_string('commentdelete', 'ouwiki') . '"/> ' . '<input type="submit" name="cancel" value="' . get_string('cancel') . '"/>';
    print '</form>';
    print_box_end();
    ouwiki_print_footer($course, $cm, $subwiki, $pagename);
}
?>

开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:29,代码来源:deletecomment.php


示例6: ouwiki_get_subwiki_missingpages

    print '</ul>';
}
$missing = ouwiki_get_subwiki_missingpages($subwiki->id);
if (count($missing) > 0) {
    print '<div class="ouw_missingpages"><h2>' . get_string('missingpages', 'ouwiki') . '</h2>';
    print '<p>' . get_string(count($missing) > 1 ? 'advice_missingpages' : 'advice_missingpage', 'ouwiki') . '</p>';
    print '<ul>';
    $first = true;
    foreach ($missing as $title => $from) {
        print '<li>';
        if ($first) {
            $first = false;
        } else {
            print ' &#8226; ';
        }
        print '<a href="view.php?' . ouwiki_display_wiki_parameters($title, $subwiki, $cm) . '">' . htmlspecialchars($title) . '</a> <span class="ouw_missingfrom">(' . get_string(count($from) > 1 ? 'frompages' : 'frompage', 'ouwiki', '<a href="view.php?' . ouwiki_display_wiki_parameters($from[0], $subwiki, $cm) . '">' . ($from[0] ? htmlspecialchars($from[0]) : get_string('startpage', 'ouwiki')) . '</a>)</span>');
        print '</li>';
    }
    print '</ul>';
    print '</div>';
}
$tree = 0;
if (!empty($treemode)) {
    $wikiparams .= '&amp;type=tree';
    $tree = 1;
}
if (count($index) != 0) {
    print '<div class="ouw_entirewiki"><h2>' . get_string('entirewiki', 'ouwiki') . '</h2>';
    print '<p>' . get_string('onepageview', 'ouwiki') . '</p><ul>';
    print '<li id="ouwiki_down_html"><a href="entirewiki.php?' . $wikiparams . '&amp;format=html">' . get_string('format_html', 'ouwiki') . '</a></li>';
    // Are there any files in this wiki?
开发者ID:salmonmoose,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:wikiindex.php


示例7: ouwiki_showtimelines


//.........这里部分代码省略.........
    // round the times to the beginning of the day
    $mintime -= $mintime % $day;
    $maxtime -= $maxtime % $day;
    // count the number of days
    $daycount = ceil(($maxtime - $mintime) / $day);
    // get the page titles
    $pages = array_keys($timeline);
    // for each page initialise every date to 0 edits
    foreach ($pages as $page) {
        // go from first edit date by user group on wiki to last edit date, a day at a time
        for ($time = $mintime; $time <= $maxtime; $time += $day) {
            // get the date
            $date = userdate($time, get_string('strftimedate'));
            // inititilise the data point to 0 edits
            $timeline[$page][$date] = 0;
        }
    }
    // init the maximum edits in a single day for scale
    $maxeditcount = 0;
    // for each edited page version count the number of edits for each page for each day
    foreach ($editpagetimes as $editpagetime) {
        // get the page title
        $page = $editpagetime->pagetitle;
        // get the edit date
        $date = userdate($editpagetime->date, get_string('strftimedate'));
        // increment the number of times the page has been edited on this date
        $timeline[$page][$date]++;
        // check for maximum edits in a single day
        $maxeditcount = max($maxeditcount, $timeline[$page][$date]);
    }
    // get min and max dates for edits by user group in wiki
    $mindate = userdate($mintime, get_string('strftimedate'));
    $maxdate = userdate($maxtime, get_string('strftimedate'));
    // Don't show it if there's nothing in it
    if (count($timeline) == 0) {
        return;
    }
    // print opening div and table tags as well as headers, the first header is the page name and link to the page
    //    and the second contains the first and last date of editing
    if (!$csv) {
        print <<<EOF
    <div class="ouw_timelines_page">
    <h3>{$header->timelinetitle}</h3>
    <table>
    <tr>
    <th scope="col">{$header->timelinepage}<div class='ouw_pagecolumn'></div></th>
    <th class="ouw_firstingroup" scope="col">{$mindate}</th><th class='ouw_rightcol ouw_lastdate' scope="col">{$maxdate}</th>
    \t    </tr>
EOF;
    } else {
        print $csv->line() . $csv->quote($header->timelinetitle) . $csv->line() . $csv->quote($header->timelinepage);
        $data = reset($timeline);
        foreach ($data as $date => $datum) {
            print $csv->sep() . $csv->quote($date);
        }
    }
    // Draw the graphs
    // for each timeline for each page
    $count = count($timeline);
    foreach ($timeline as $pagetitle => $data) {
        // if no title then must be start page of wiki, create link to this
        if ($pagetitle === '') {
            // get the parameters to view the subwiki pages
            $pageparams = ouwiki_display_wiki_parameters(null, $subwiki, $cm);
            // create a link to the page
            $pagelink = "<a href='view.php?" . $pageparams . "'>" . get_string('startpage', 'ouwiki') . "</a>";
        } else {
            // get the page params to link to the page
            $pageparams = ouwiki_display_wiki_parameters($pagetitle, $subwiki, $cm);
            // create a link to the page
            $pagelink = "<a href='view.php?" . $pageparams . "'>" . htmlspecialchars($pagetitle) . "</a>";
        }
        // print the title and link to the page
        $count--;
        if (!$csv) {
            print "\n        \t<tr" . ($count == 0 ? " class='ouw_lastrow'" : "") . ">\n        <td class='ouw_leftcol'>{$pagelink}</td>\n        <td class='ouw_rightcol ouw_firstingroup' colspan='2'>";
            // print the bar chart for the page timeline data, max edit count is for an even scale,
            // the numbers are the size of each graph => width, height
            barchart($data, 800, 20, $maxeditcount);
            // close the tags for the row
            print "\n        \t\t<div class='clearer'></div></td>\n        \t</tr>";
        } else {
            if ($pagetitle === '') {
                $pagetitle = get_string('startpage', 'ouwiki');
            }
            print $csv->line() . $csv->quote(htmlspecialchars($pagetitle));
            foreach ($data as $date => $datum) {
                print $csv->sep() . $csv->quote($datum);
            }
        }
    }
    // close the table and div tags for the timeline data
    if (!$csv) {
        print '
    	</table>
    </div>';
    } else {
        print $csv->line();
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:reportslib.php


示例8: date

    <link>' . $pagelink . '</link>
    <pubDate>' . date('r', reset($changes)->timecreated) . '</pubDate>';
} else {
    print '
<feed xmlns="http://www.w3.org/2005/Atom">
  <link rel="self" href="' . $feedlink . '"/>
  <link rel="alternate" type="text/html" href="' . $pagelink . '"/>
  <title>' . $feedtitle . '</title>
  <subtitle>' . $feeddescription . '</subtitle>
  <updated>' . date('c', reset($changes)->timecreated) . '</updated>
  <author>
    <name>Wiki system</name>
  </author>
  <id>' . $id . '</id>';
}
$pageparams = ouwiki_display_wiki_parameters($pagename, $subwiki, $cm);
foreach ($changes as $change) {
    $a = new StdClass();
    $a->name = htmlspecialchars(fullname($change));
    if ($change->versionid == $pageversion->versionid) {
        $itemlink = $CFG->wwwroot . '/mod/ouwiki/view.php?' . $pageparams;
    } else {
        $itemlink = $CFG->wwwroot . '/mod/ouwiki/viewold.php?' . $pageparams . '&amp;version=' . $change->versionid;
    }
    $itemtitle = $ouwiki->name . ' - ' . $pagetitle . ' (' . ouwiki_nice_date($change->timecreated) . ')';
    $nextchange = next($changes);
    if ($nextchange) {
        $a->url = $CFG->wwwroot . '/mod/ouwiki/diff.php?' . $pageparams . '&amp;v1=' . $nextchange->versionid . '&amp;v2=' . $change->versionid;
        $a->main = get_string('feedchange', 'ouwiki', $a);
    } else {
        $a->main = get_string('feednewpage', 'ouwiki', $a);
开发者ID:ndunand,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:feed-history.php


示例9: ouwiki_get_annotate_link

 /**
  * Get html for the annotate link.
  *
  * @param string $str
  * @param string $pagename
  * @param object $subwiki
  * @param object $cm
  * @param string $xhtmlid
  * @return string
  */
 public function ouwiki_get_annotate_link($pagename, $subwiki, $cm)
 {
     global $CFG;
     return ' ' . html_writer::tag('a', get_string('annotate', 'ouwiki'), array('href' => $CFG->wwwroot . '/mod/ouwiki/annotate.php?' . ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_URL), 'class' => 'ouw_annotate'));
 }
开发者ID:salmonmoose,项目名称:moodle-mod_ouwiki,代码行数:15,代码来源:renderer.php


示例10: dirname

require_once dirname(__FILE__) . '/../../config.php';
require_once $CFG->dirroot . '/local/ousearch/searchlib.php';
require $CFG->dirroot . '/mod/ouwiki/basicpage.php';
$querytext = required_param('query', PARAM_RAW);
$url = new moodle_url('/mod/ouwiki/search.php', array('id' => $id, 'user' => $userid, 'query' => $querytext));
$PAGE->set_url($url);
$ouwikioutput = $PAGE->get_renderer('mod_ouwiki');
echo $ouwikioutput->ouwiki_print_start($ouwiki, $cm, $course, $subwiki, get_string('searchresults'), $context, null, null, null, '', '', $querytext);
echo html_writer::start_div();
$query = new local_ousearch_search($querytext);
$query->set_coursemodule($cm);
if ($subwiki->groupid) {
    $query->set_group_id($subwiki->groupid);
}
if ($subwiki->userid) {
    $query->set_user_id($subwiki->userid);
}
$foundsomething = $query->display_results('search.php?' . ouwiki_display_wiki_parameters('', $subwiki, $cm));
echo $foundsomething;
// Add link to search the rest of this website if service available.
if (!empty($CFG->block_resources_search_baseurl)) {
    $params = array('course' => $course->id, 'query' => $querytext);
    $restofwebsiteurl = new moodle_url('/blocks/resources_search/search.php', $params);
    $strrestofwebsite = get_string('restofwebsite', 'local_ousearch');
    $altlink = html_writer::start_tag('div', array('class' => 'advanced-search-link'));
    $altlink .= html_writer::link($restofwebsiteurl, $strrestofwebsite);
    $altlink .= html_writer::end_tag('div');
    print $altlink;
}
// Footer
ouwiki_print_footer($course, $cm, $subwiki, null, 'search.php?query=' . urlencode($querytext), $foundsomething ? null : 'searchfailure', $querytext);
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:search.php


示例11: reportssummary_editedpagetable

/**
 * This prints a table showing the info about each page including the name of the page with a link to the page;
 *   the number of contributors, edits, comments, intensity; the number of edits and comments by role;
 *   the date of the first and last edits; the number of words and number of links to the page.
 *
 * @param object $subwiki        the subwiki id 
 * @param object $cm			
 * @param int $viewgroupid    the group id
 * @param object $header         the header text object
 * @param unknown_type $pagesinfo      the title, first day of editing, last day and text of each page
 * @param array $rolenames	   the array of role names
 * @param unknown_type $pageeditcount  the array of edit counts for each page
 * @param unknown_type $editsbyroles   the array of edit counts for each role
 * @param unknown_type $pagecontributorcount   the number of contributors on each page
 * @param int $totalusers             the total number of users
 * @param unknown_type $pagecommentcount       the number of comments on each page
 * @param unknown_type $commentsbyroles        the number of comments by each role
 */
function reportssummary_editedpagetable($contexts, $subwiki, $cm, $viewgroupid, $header, $pagesinfo, $rolenames, $pageeditcount, $editsbyroles, $pagecontributorcount, $totalusers, $pagecommentcount, $commentsbyroles, $csv)
{
    // list of edited pages table
    // get the data from the database
    // get the number of pages that link to the each page
    $pagelinks = ouwiki_get_pagelinks($subwiki->id);
    // get the collaboration intensity
    $collabintensity = ouwiki_get_collaborationintensity($contexts, $subwiki->id, $viewgroupid);
    // this function prints out the first two header rows of the table
    reportssummary_editedpagetableheaders($header, $rolenames, $csv);
    // for each page in the subwiki, use the info to display a row of data
    foreach ($pagesinfo as $pageid => $pageinfo) {
        // get the page title
        $title = $pageinfo->title;
        // get total number of edits on page
        $editcount = $pageeditcount[$title];
        // get total number of conrtributors for page
        $contributorcount = $pagecontributorcount[$title];
        // calc percentage of contributers from all users
        $contribpercent = $totalusers != 0 ? round($contributorcount / $totalusers * 100, 1) : 0;
        // get the number of total comments on the page
        $commentcount = $pagecommentcount[$title];
        // calc the number of words in the page text
        $wordcount = str_word_count(strip_tags($pageinfo->text));
        // get the first day of editing on the page
        $startday = userdate($pageinfo->startday, get_string('strftimedate'));
        // get the last day of editing on the page
        $lastday = userdate($pageinfo->lastday, get_string('strftimedate'));
        // get the number of links to the page
        $linkcount = isset($pagelinks[$pageid]) ? $pagelinks[$pageid]->linkcount : 0;
        // get the page params to link to the page
        $pageparams = ouwiki_display_wiki_parameters($title, $subwiki, $cm);
        // create a link to the page
        $pagelink = "<a href='view.php?" . $pageparams . "'>" . htmlspecialchars($title) . "</a>";
        // if no title then must be start page of wiki, create link to this
        if ($title === null) {
            // get the parameters to view the subwiki pages
            $pageparams = ouwiki_display_wiki_parameters(null, $subwiki, $cm);
            $pagelink = "<a href='view.php?" . $pageparams . "'>" . get_string('startpage', 'ouwiki') . "</a>";
        }
        // get the collaboration intensity
        $collaboration = isset($collabintensity[$pageid]) ? $collabintensity[$pageid] : ($editcount ? 0 : '');
        // start the row of data in the table for the current page and print the first four bits of info:
        //    page name and link, contributor count with percentage, edit count and comment count
        if (!$csv) {
            print "\n        <tr>\n        \t<td class='ouw_leftcol'>{$pagelink}</td>\n           \t<td>{$contributorcount} ({$contribpercent}%)</td>           \t\t\t\n           \t<td>{$editcount}</td>\n           \t<td>{$commentcount}</td>           \t\t\t\n           \t<td class='ouw_datecolumn'>{$startday}</td>\n           \t<td class='ouw_datecolumn'>{$lastday}</td>\n           \t<td>{$wordcount}</td>\n           \t<td>{$linkcount}</td>\n           \t<td>{$collaboration}</td>\n           \t";
        } else {
            if ($title === null) {
                $title = get_string('startpage', 'ouwiki');
            }
            print $csv->quote(htmlspecialchars($title)) . $csv->sep() . $csv->quote($contributorcount . ' (' . $contribpercent . '%)') . $csv->sep() . $csv->quote($editcount) . $csv->sep() . $csv->quote($commentcount) . $csv->sep() . $csv->quote($startday) . $csv->sep() . $csv->quote($lastday) . $csv->sep() . $csv->quote($wordcount) . $csv->sep() . $csv->quote($linkcount) . $csv->sep() . $csv->quote($collaboration) . $csv->sep();
        }
        // for each role name, print the info for that role: edits, comments and intensity
        $count = count($rolenames);
        foreach ($rolenames as $roleid => $rolename) {
            $count--;
            $endornot = $count ? '' : ' class="ouw_rightcol"';
            // get the number of edits by current role
            $editsbyrole = $editsbyroles[$roleid];
            $roleeditcount = isset($editsbyrole[$pageid]) ? $editsbyrole[$pageid]->editcount : 0;
            // get the number of comments by role
            $commentsbyrole = $commentsbyroles[$roleid];
            $rolecommentcount = isset($commentsbyrole[$pageid]) ? $commentsbyrole[$pageid]->commentcount : 0;
            // print the 3 data columns for the role name: edits, comments and collaboration
            if (!$csv) {
                print "\n        \t\t<td class='ouw_firstingroup'>{$roleeditcount}</td>\n        \t\t<td{$endornot}>{$rolecommentcount}</td>\n        \t\t";
            } else {
                print $csv->quote($roleeditcount) . $csv->sep() . $csv->quote($rolecommentcount) . $csv->sep();
            }
        }
        // print the data columns for the current page: first day of editing,
        //    last day of editing, word count and number of links
        if (!$csv) {
            print "           \t\t\t\n   \t\t</tr>\n   \t\t";
        } else {
            print $csv->line();
        }
    }
    // close the table and div tags
    $strintensityexplanation = get_string('report_intensityexplanation', 'ouwiki');
    if (!$csv) {
        print "\n\t</table>\n\t<p><small>\n\t  * {$strintensityexplanation}\n\t</small></p>\n</div>\n";
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:reportsgroup.php


示例12: ouwiki_display_create_page_form

/**
 * @param object $subwiki For details of user/group and ID so that
 *   we can make links
 * @param object $cm Course-module object (again for making links)
 * @param object $pageversion Data from page and version tables.
 * @return string HTML content for page
 */
function ouwiki_display_create_page_form($subwiki, $cm, $pageversion)
{
    $result = '';
    $genericformdetails = '<form method="get" action="edit.php">
<div class="ouwiki_addnew_div">
<input type="hidden" name="originalpagename" value="' . $pageversion->title . '" />
' . ouwiki_display_wiki_parameters($pageversion->title, $subwiki, $cm, $type = OUWIKI_PARAMS_FORM);
    $result .= '<div id="ouwiki_addnew"><ul>
<li>
' . $genericformdetails . '
' . get_string('addnewsection', 'ouwiki') . '
<input type="text" size="30" name="newsectionname" id="ouw_newsectionname" value="' . get_string('typeinsectionname', 'ouwiki') . '" />
<input type="submit" id="ouw_add" name="ouw_subb" value="' . get_string('add', 'ouwiki') . '" />
</div>
</form>
</li>
<li>
' . $genericformdetails . '
' . get_string('createnewpage', 'ouwiki') . '
<input type="text" name="page" id="ouw_newpagename" size="30" value="' . get_string('typeinpagename', 'ouwiki') . '" />
<input type="submit" id="ouw_create" name="ouw_subb" value="' . get_string('create', 'ouwiki') . '" />
</div>
</form>
</li>
</ul>
</div>';
    return $result;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:35,代码来源:ouwiki.php


示例13: require_login

//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Toggles the controls whether to load HQ videos or SQ videos for this user
 * @package mod_ouwiki
 * @copyright 2012 The Open University
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require '../../config.php';
require $CFG->dirroot . '/mod/ouwiki/basicpage.php';
require_login();
require_sesskey();
$hide = required_param('hide', PARAM_INT);
if ($hide) {
    set_user_preference(OUWIKI_PREF_HIDEANNOTATIONS, 1);
} else {
    unset_user_preference(OUWIKI_PREF_HIDEANNOTATIONS);
}
// If this is the AJAX version, stop processing now.
if (optional_param('ajax', 0, PARAM_INT)) {
    exit;
}
// Otherwise redirect back.
redirect('view.php?' . ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_URL));
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:30,代码来源:hideannotations.php


示例14: error

if (!preg_match('/^[0-9]+_[0-9]+$/', $section)) {
    $section = null;
}
if ($section) {
    if (!array_key_exists($section, $knownsections)) {
        error("Unknown section {$section}");
    }
    $sectiontitle = $knownsections[$section];
}
// Get other parameters
$fromphp = required_param('fromphp', PARAM_RAW);
$title = stripslashes(required_param('title', PARAM_RAW));
$xhtml = stripslashes(required_param('xhtml', PARAM_CLEAN));
// Work out redirect url
if ($fromphp == 'view') {
    $url = 'view.php?' . ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_URL) . '&showcomments' . ($section ? '#ouw_s' . $section : '');
} else {
    $url = 'comments.php?' . ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_URL) . ($section ? '&section=' . $section : '');
}
if ('' == preg_replace('/(<.*?>)|(&nbsp;)|\\s/', '', $xhtml)) {
    error(get_string('commentblank', 'ouwiki'), $url);
}
// Check post permission
require_capability('mod/ouwiki:comment', $context);
// Add post
ouwiki_add_comment($pageversion->pageid, $section, $section ? $sectiontitle : null, $title, $xhtml);
// Redirect
redirect($url);
?>

开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:29,代码来源:addcomment.php


示例15: print_error

    print_error('invalidcoursemodule');
}
$PAGE->set_cm($cm);
// When creating a new page, do some checks
$addpage = false;
if (!is_null($frompage)) {
    $urlparams['frompage'] = $frompage;
    $returnurl = new moodle_url('/mod/ouwiki/view.php', ouwiki_display_wiki_parameters($frompage, $subwiki, $cm, OUWIKI_PARAMS_ARRAY));
    if (trim($pagename) === '') {
        print_error('emptypagetitle', 'ouwiki', $returnurl);
    }
    // Strip whitespace from new page name from form (editor does this for other links).
    $pagename = preg_replace('/\\s+/', ' ', $pagename);
    $addpage = true;
}
$returnurl = new moodle_url('/mod/ouwiki/view.php', ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_ARRAY));
// When creating a section, do checks
$addsection = false;
if (!is_null($newsection)) {
    if (trim($newsection) === '') {
        print_error('emptysectiontitle', 'ouwiki', $returnurl);
    }
    $addsection = true;
}
$context = context_module::instance($cm->id);
$PAGE->set_pagelayout('incourse');
require_course_login($course, true, $cm);
$ouwikioutput = $PAGE->get_renderer('mod_ouwiki');
require_capability('mod/ouwiki:edit', $context);
$url = new moodle_url('/mod/ouwiki/edit.php', $urlparams);
$PAGE->set_url($url);
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:edit.php


示例16: str_repeat

                print str_repeat($csv->sep(), 8);
            }
        }
    }
    // close the row tag
    if (!$csv) {
        print '
   	</tr>';
    } else {
        print $csv->line();
    }
}
// close table and div tags
if (!$csv) {
    print '
   	</table>
</div>';
} else {
    // That's it for downloading csv file
    exit;
}
// For non-group wiki, also offer non-group view link
if (!$subwiki->groupid) {
    print '<p><a href="reportsgroup.php?' . ouwiki_display_wiki_parameters(null, $subwiki, $cm) . '&amp;viewgroup=0">' . get_string('report_viewallgroups', 'ouwiki') . '</a></p>';
}
// Display csv download links
$wikiparams = ouwiki_display_wiki_parameters(null, $subwiki, $cm);
print '<ul class="csv-links"><li><a href="reportssummary.php?' . $wikiparams . '&amp;format=csv">' . get_string('csvdownload', 'ouwiki') . '</a></li>
    <li><a href="reportssummary.php?' . $wikiparams . '&amp;format=excelcsv">' . get_string('excelcsvdownload', 'ouwiki') . '</a></li></ul>';
// Footer
ouwiki_print_footer($course, $cm, $subwiki);
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:reportssummary.php


示例17: dirname

 *
 * @copyright &copy; 2009 The Open University
 * @author [email protected]
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package ouwiki
 */
require_once dirname(__FILE__) . '/../../config.php';
require $CFG->dirroot . '/mod/ouwiki/basicpage.php';
$id = required_param('id', PARAM_INT);
// Course Module ID that defines wiki
// check we are using the annotation system
$action = required_param('ouw_lock', PARAM_RAW);
$pageid = required_param('ouw_pageid', PARAM_INT);
// Get the current page version, creating page if needed
$pageversion = ouwiki_get_current_page($subwiki, $pagename, OUWIKI_GETPAGE_ACCEPTNOVERSION);
$wikiformfields = ouwiki_display_wiki_parameters($pagename, $subwiki, $cm, OUWIKI_PARAMS_FORM);
$sectionfields = '';
// get the context and check user has the required capability
require_capability('mod/ouwiki:lock', $context);
$ouwikioutput = $PAGE->get_renderer('mod_ouwiki');
// Get an editing lock
list($lockok, $lock) = ouwiki_obtain_lock($ouwiki, $pageversion->pageid);
// Handle case where page is locked by someone else
if (!$lockok) {
    // Print header etc
    echo $ouwikioutput->ouwiki_print_start($ouwiki, $cm, $course, $subwiki, $pagename, $context);
    $details = new StdClass();
    $lockholder = $DB->get_record('user', array('id' => $lock->userid));
    $details->name = fullname($lockholder);
    $details->lockedat = ouwiki_nice_date($lock->lockedat);
    $details->seenat = ouwiki_nice_date($lock->seenat);
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:lock.php


示例18: switch

    switch ($format) {
        case OUWIKI_FORMAT_TEMPLATE:
            print '<page>';
            if ($pageversion->title !== '') {
                print '<title>' . htmlspecialchars($pageversion->title) . '</title>';
            }
            print '<xhtml>' . htmlspecialchars($pageversion->xhtml) . '</xhtml>';
            print '</page>';
            break;
        case OUWIKI_FORMAT_RTF:
            $html .= '<h1>' . htmlspecialchars($visibletitle) . '</h1>';
            $html .= trim($pageversion->xhtml);
            $html .= '<br /><br /><hr />';
            break;
        case OUWIKI_FORMAT_HTML:
            print '<div class="ouw_entry"><a name="' . $pageversion->pageid . '"></a><h1 class="ouw_entry_heading"><a href="view.php?' . ouwiki_display_wiki_parameters($pageversion->title, $subwiki, $cm) . '">' . htmlspecialchars($visibletitle) . '</a></h1>';
            print ouwiki_convert_content($pageversion->xhtml, $subwiki, $cm, $index, $pageversion->xhtmlformat);
            print '</div>';
            break;
    }
    if ($first) {
        $first = false;
    }
}
switch ($format) {
    case OUWIKI_FORMAT_TEMPLATE:
        print '</wiki>';
        break;
    case OUWIKI_FORMAT_RTF:
        $html .= '</root>';
        rtf_from_html($filename . '.rtf', $html);
开发者ID:ndunand,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:entirewiki.php


示例19: ouwiki_render_user_participation

 /**
  * Render single user participation record for display
  *
  * @param object $user
  * @param array $changes user participation
  * @param object $cm
  * @param object $course
  * @param object $ouwiki
  * @param object $subwiki
  * @param string $pagename
  * @param int $groupid
  * @param string $download
  * @param bool $canview level of participation user can view
  * @param object $context
  * @param string $fullname
  * @param bool $cangrade permissions to grade user participation
  * @param string $groupname
  */
 public function ouwiki_render_user_participation($user, $changes, $cm, $course, $ouwiki, $subwiki, $pagename, $groupid, $download, $canview, $context, $fullname, $cangrade, $groupname)
 {
     global $DB, $CFG, $OUTPUT;
     require_once $CFG->dirroot . '/mod/ouwiki/participation_table.php';
     $filename = "{$course->shortname}-" . format_string($ouwiki->name, true);
     if (!empty($groupname)) {
         $filename .= '-' . format_string($groupname, true);
     }
     $filename .= '-' . format_string($fullname, true);
     // setup the table
     $table = new ouwiki_user_participation_table($cm, $course, $ouwiki, $pagename, $groupname, $user, $fullname);
     $table->setup($download);
     $table->is_downloading($download, $filename, get_string('participation', 'ouwiki'));
     // participation doesn't need standard ouwiki tabs so we need to
     // add this one div in manually
     if (!$table->is_downloading()) {
         echo html_writer::start_tag('div', array('id' => 'ouwiki_belowtabs'));
     }
     $previouswordcount = false;
     $lastdate = null;
     foreach ($changes as $change) {
         $date = userdate($change->timecreated, get_string('strftimedate'));
         $time = userdate($change->timecreated, get_string('strftimetime'));
         if (!$table->is_downloading()) {
             if ($date == $lastdate) {
                 $date = null;
             } else {
                 $lastdate = $date;
             }
             $now = tim 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ouwiki_get_current_page函数代码示例发布时间:2022-05-15
下一篇:
PHP ouwiki_diff_html函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap