Skip to content

Commit

Permalink
OSEP: OU wiki - basic redesign #105099
Browse files Browse the repository at this point in the history
  • Loading branch information
Beedell authored and sammarshallou committed Feb 1, 2016
1 parent 6d47524 commit a793f56
Show file tree
Hide file tree
Showing 13 changed files with 511 additions and 237 deletions.
3 changes: 3 additions & 0 deletions annotate.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,13 @@
$customdata[2] = $pagename;
$customdata[3] = $userid;
$customdata[4] = has_capability('mod/ouwiki:lock', $context);
echo html_writer::start_div('ouw-annotation-list');
echo html_writer::tag('h2', get_string('annotations', 'ouwiki'));
echo html_writer::end_div();

$annotateform = new mod_ouwiki_annotate_form('annotate.php?id='.$id, $customdata);
$annotateform->display();
echo $ouwikioutput->get_bottom_buttons($subwiki, $cm, $context, $pageversion, true);

$usedannotations = array();
foreach ($annotations as $annotation) {
Expand Down
3 changes: 2 additions & 1 deletion annotate_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public function definition() {
$editnumber = 1;
foreach ($annotations as $annotation) {
if (!$annotation->orphaned) {
$mform->addElement('textarea', 'edit'.$annotation->id, $editnumber, array('cols'=>'40', 'rows'=>'3'));
$mform->addElement('textarea', 'edit'.$annotation->id, '(' . $editnumber . ')',
array('cols'=>'40', 'rows'=>'3'));
$mform->setDefault('edit'.$annotation->id, $annotation->content);
$editnumber++;
} else {
Expand Down
3 changes: 2 additions & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@

// print the preview box
if ($content) {
$ouwikioutput = $PAGE->get_renderer('mod_ouwiki');
echo $ouwikioutput->ouwiki_print_preview($content, $pagename, $subwiki, $cm, $pageversion->xhtmlformat);
$existing = $content;
}
Expand Down Expand Up @@ -477,6 +476,8 @@

$mform->display();

echo $ouwikioutput->get_bottom_buttons($subwiki, $cm, $context, $pageversion, false);

$stringlist = array(
array('savefailnetwork', 'ouwiki'),
array('savefailtitle', 'ouwiki'),
Expand Down
23 changes: 12 additions & 11 deletions history.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
<form name='ouw_history' class='ouw_history' method='get' action='history.php'>
<input type='hidden' name='compare' value='1'/>
$wikiinputs
<table>
<table class='generaltable'>
<thead>
<tr><th scope='col'>".get_string('date')."</th><th scope='col'>".get_string('time')."</th><th><span class='accesshide'>".get_string('actionheading', 'ouwiki')."</span>
</th>";
if ($ouwiki->enablewordcount) {
Expand All @@ -142,7 +143,7 @@
print '<th scope="col">'.get_string('importedfrom', 'ouwiki').'</th>';
}
print "<th scope='col'>".get_string('changedby', 'ouwiki')."</th><th scope='col'><span class='accesshide'>".get_string('compare', 'ouwiki')."</span></th>";
print '</tr>';
print '</thead></tr><tbody>';

$lastdate = '';
$changeindex = 0;
Expand Down Expand Up @@ -247,9 +248,11 @@
$changeindex++;
}

print "
<tr><td colspan='5' class='comparebutton'><input id='ouw_comparebutton' type='submit' value='".get_string('compareselected', 'ouwiki')."' /></td></tr>
</table></form>";
print "</tbody></table>";
$input = '<input id="ouw_comparebutton" type="submit" value="' .
get_string('compareselected', 'ouwiki') . '" class="osep-smallbutton" />';
echo html_writer::div($input, 'ouw-comparebutton-wrapper');
print "</form>";

// The page works without JS. If you do have it, though, this script ensures
// you can't click compare without having two versions selected.
Expand All @@ -272,12 +275,10 @@ function ouw_check() {
</script>
';

$a = new stdClass();
$a->atom = $atomurl;
$a->rss = $rssurl;
print '<p class="ouw_subscribe"><a href="'.$atomurl.'" title="'.get_string('feedalt', 'ouwiki').
'"><img src="'.$OUTPUT->pix_url('rss', 'ouwiki').'" alt=""/></a> <span>'.
get_string('feedsubscribe', 'ouwiki', $a).'</span></p>';
echo $ouwikioutput->ouwiki_get_feeds($atomurl, $rssurl);

$pageversion = ouwiki_get_current_page($subwiki, $pagename);
echo $ouwikioutput->get_bottom_buttons($subwiki, $cm, $context, $pageversion, false);

// Footer
ouwiki_print_footer($course, $cm, $subwiki, $pagename);
1 change: 1 addition & 0 deletions lang/en/ouwiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
$string['add']='Add';
$string['typeinsectionname']='Type section title here';
$string['addnewsection']='Add new section to this page';
$string['addnewsection1']='Add new section';
$string['createdbyon'] = 'created by {$a->name} on {$a->date}';

$string['numedits'] = '{$a} edits';
Expand Down
4 changes: 2 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,7 @@ function ouwiki_display_create_page_form($subwiki, $cm, $pageversion) {
$result .= '<label for="ouw_newsectionname">' . get_string('addnewsection', 'ouwiki') . '</label> ' .
'<input type="text" size="30" name="newsection" id="ouw_newsectionname" value="" />' .
'<input type="submit" id="ouw_add" name="ouw_subb" value="' .
get_string('add', 'ouwiki').'" />' .
get_string('add', 'ouwiki').'" class="osep-smallbutton" />' .
'</div></form></li>';

// Create new page.
Expand All @@ -2290,7 +2290,7 @@ function ouwiki_display_create_page_form($subwiki, $cm, $pageversion) {
'<label for="ouw_newpagename">' . get_string('createnewpage', 'ouwiki') . '</label> '.
'<input type="text" name="page" id="ouw_newpagename" size="30" value="" />' .
'<input type="submit" id="ouw_create" name="ouw_subb" value="' .
get_string('create', 'ouwiki') . '" />' .
get_string('create', 'ouwiki') . '" class="osep-smallbutton" />' .
'</div></form></li>';

$result .= '</ul></div>';
Expand Down
2 changes: 2 additions & 0 deletions participation.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@

// Footer
if (empty($download)) {
$pageversion = ouwiki_get_current_page($subwiki, $pagename);
echo $ouwikioutput->get_bottom_buttons($subwiki, $cm, $context, $pageversion, false);
ouwiki_print_footer($course, $cm, $subwiki, $pagename, null, 'view');
}
Loading

0 comments on commit a793f56

Please sign in to comment.