Skip to content

Commit

Permalink
OU blog: Design changes so it uses normal theme block styles #1852
Browse files Browse the repository at this point in the history
  • Loading branch information
athompson697 authored and sammarshallou committed May 9, 2012
1 parent 7ea1f10 commit dd40395
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 81 deletions.
35 changes: 16 additions & 19 deletions allposts.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,34 @@
$buttontext='';
}
$url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cm->id, 'return' => true, 'sesskey' => sesskey()));
$buttontext .= $OUTPUT->single_button($url, $stroublog);
$PAGE->set_button($buttontext);

$PAGEWILLCALLSKIPMAINDESTINATION = true; // OU accessibility feature

echo $OUTPUT->header();


print '<div class="oublog-topofpage"></div>';

// The left column ...
if($hasleft=!empty($CFG->showblocksonmodpages) && blocks_have_content($pageblocks, BLOCK_POS_LEFT) ) {
print '<div id="left-column">';
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
print '</div>';
}

$hasleft = !empty($CFG->showblocksonmodpages);
// The right column, BEFORE the middle-column.
print '<div id="right-column">';
if (isloggedin() and !isguestuser()) {
list($oublog, $oubloginstance) = oublog_get_personal_blog($USER->id);
$blogeditlink = "<br /><a href=\"view.php\" class=\"oublog-links\">$oubloginstance->name</a>";
print_side_block(format_string($oublog->name), $blogeditlink, NULL, NULL, NULL, array('id' => 'oublog-summary'),get_string('bloginfo','oublog'));
$bc = new block_contents();
$bc->attributes['id'] = 'oublog-links';
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = format_string($oublog->name);
$bc->content = $blogeditlink;
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}

if ($feeds = oublog_get_feedblock($oublog, 'all', '', false, $cm)) {
print_side_block($strfeeds, $feeds, NULL, NULL, NULL, array('id' => 'oublog-feeds'),$strfeeds);
$bc = new block_contents();
$bc->attributes['id'] = 'oublog-feeds';
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = $strfeeds;
$bc->content = $feeds;
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}

print '</div>';

// Must be called after add_fake_blocks
echo $OUTPUT->header();
// Start main column
$classes='';
$classes.=$hasleft ? 'has-left-column ' : '';
Expand Down Expand Up @@ -159,6 +156,6 @@
print '<p class="oublog_noposts">'.
get_string('noposts','oublog').'</p>';
}

print '</div>';
/// Finish the page
echo $OUTPUT->footer();
4 changes: 2 additions & 2 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function oublog_print_post($cm, $oublog, $post, $baseurl, $blogtype, $can

$formattedtitle = format_string($post->title);
if (trim($formattedtitle) !== '') {
$output .= html_writer::tag('h2', format_string($post->title), array('class'=>'oublog-title'));
$output .= html_writer::tag('h3', format_string($post->title), array('class'=>'oublog-title'));
}

if ($post->deletedby) {
Expand Down Expand Up @@ -532,7 +532,7 @@ public function render_user_participation_list($cm, $course, $oublog, $participa

// Comment title
if (isset($comment->title) && !empty($comment->title)) {
$output .= html_writer::tag('h4', s($comment->title),
$output .= html_writer::tag('h3', s($comment->title),
array('class' => 'oublog-comment-title'));
}

Expand Down
32 changes: 26 additions & 6 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
background-color: #FCFCFC;
min-height:0; /* ie7 */
}
.oublog-sideblock {
border: 1px solid #ddd;
margin: 0 0 1em;
padding: 0.5em;
background-color: #F2F2F2;
min-height:0; /* ie7 */
}
.ie6 .oublog-post *, .ie6 .oublog-comment *,
.ie6 .oublog-post, .ie6 .oublog-comment {
height:0;
Expand Down Expand Up @@ -91,6 +98,15 @@
font-size:1em;
}

.oublog-post h3.oublog-title {
font-size: 1em;
margin: 0 0 0.5em 0;
padding-bottom: 4px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #aaaaaa;
}

.oublog-post-content,
.oublog-comment-content {
margin:0.4em 0;
Expand Down Expand Up @@ -124,6 +140,15 @@
border-bottom-color: #aaaaaa;
}

.oublog-comment h3.oublog-comment-title {
margin: 0 0 0.5em 0;
font-size: 1em;
padding-bottom: 4px;
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #aaaaaa;
}

.oublog-comment h3, .oublog-comment h4 {
margin: 0em;
}
Expand Down Expand Up @@ -170,12 +195,7 @@
width:12em;
float:right;
}
#page-mod-oublog-view #middle-column.has-right-column,
#page-mod-oublog-viewpost #middle-column.has-right-column,
#page-mod-oublog-viewedit #middle-column.has-right-column,
#page-mod-oublog-allposts #middle-column.has-right-column {
margin-right:13em;
}

#page-mod-oublog-view #middle-column.has-left-column,
#page-mod-oublog-viewpost #middle-column.has-left-column,
#page-mod-oublog-allposts #middle-column.has-left-column {
Expand Down
44 changes: 26 additions & 18 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,46 +193,54 @@
}
$PAGE->set_title(format_string($oublog->name));
$PAGE->set_heading(format_string($oublog->name));
echo $OUTPUT->header();
print '<div class="oublog-topofpage"></div>';


// Initialize $PAGE, compute blocks
$editing = $PAGE->user_is_editing();

// The left column ...
if($hasleft=!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing)) {
print '<div id="left-column">';
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
print '</div>';
}

$hasleft = !empty($CFG->showblocksonmodpages) || $editing;
// The right column, BEFORE the middle-column.
print '<div id="right-column">';

if(!$hideunusedblog) {
// Name, summary, related links
echo $oublogoutput->oublog_print_summary_block($oublog, $oubloginstance, $canmanageposts);
$bc = new block_contents();
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = format_string($oublog->name);
$bc->content = format_text($oublog->summary);
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);

/// Tag Cloud
if ($tags = oublog_get_tag_cloud($returnurl, $oublog, $currentgroup, $cm, $oubloginstanceid, $currentindividual)) {
print_side_block($strtags, $tags, NULL, NULL, NULL, array('id' => 'oublog-tags'),$strtags);
$bc = new block_contents();
$bc->attributes['id'] = 'oublog-tags';
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = $strtags;
$bc->content = $tags;
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}

/// Links
// Links
$links = oublog_get_links($oublog, $oubloginstance, $context);
if ($links) {
print_side_block($strlinks, $links, NULL, NULL, NULL, array('id' => 'oublog-links'),$strlinks);
$bc = new block_contents();
$bc->attributes['id'] = 'oublog-links';
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = $strlinks;
$bc->content = $links;
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}

// Feeds
if ($feeds = oublog_get_feedblock($oublog, $oubloginstance, $currentgroup, false, $cm, $currentindividual)) {
$feedicon = ' <img src="'.$OUTPUT->pix_url('i/rss').'" alt="'.get_string('blogfeed', 'oublog').'" class="feedicon" />';
print_side_block($strfeeds . $feedicon, $feeds, NULL, NULL, NULL, array('id' => 'oublog-feeds'), $strfeeds);
$bc = new block_contents();
$bc->attributes['class'] = 'oublog-sideblock block';
$bc->title = $strfeeds . $feedicon;
$bc->content = $feeds;
$PAGE->blocks->add_fake_block($bc, BLOCK_POS_RIGHT);
}
}

print '</div>';
// Must be called after add_fake_blocks
echo $OUTPUT->header();

// Start main column
$classes='';
Expand Down
43 changes: 7 additions & 36 deletions viewpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@
$PAGE->navbar->add($blogname, new moodle_url("/mod/oublog/view.php", array('user' => $oubloginstance->userid)));

$url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cm->id, 'return' => true, 'sesskey' => sesskey()));
$buttontext = $OUTPUT->single_button($url, $stroublog);

} else {
$blogtype = 'course';
$returnurl = 'view.php?id='.$cm->id;
$blogname = $oublog->name;
$url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cm->id, 'return' => true, 'sesskey' => sesskey()));
$buttontext = $OUTPUT->single_button($url, $blogname);
}
$PAGE->set_button($buttontext);

$CFG->additionalhtmlhead .= oublog_get_meta_tags($oublog, $oubloginstance, $currentgroup, $cm);
$PAGE->set_title(format_string($oublog->name));
$PAGE->set_heading(format_string($course->fullname));
Expand All @@ -106,34 +104,8 @@
/// Print the main part of the page
echo '<div class="oublog-topofpage"></div>';

// The right column, BEFORE the middle-column.
print '<div id="right-column">';

// Title & Print summary
// Name, summary, related links
echo $oublogoutput->oublog_print_summary_block($oublog, $oubloginstance, $canmanageposts);

// Tag Cloud
if ($tags = oublog_get_tag_cloud($returnurl, $oublog, $currentgroup, $cm, $oubloginstance->id)) {
print_side_block($strtags, $tags, NULL, NULL, NULL, array('id' => 'oublog-tags'));
}


/// Links
if ($links = oublog_get_links($oublog, $oubloginstance, $context)) {
print_side_block($strlinks, $links, NULL, NULL, NULL, array('id' => 'oublog-links'));
}

$individual = optional_param('individual', false, PARAM_INT);
if ($feeds = oublog_get_feedblock($oublog, $oubloginstance, $currentgroup, false, $cm, $individual)) {
$feedicon = ' <img src="'.$OUTPUT->pix_url('i/rss').'" alt="'.get_string('blogfeed', 'oublog').'" class="feedicon" />';
print_side_block($strfeeds . $feedicon, $feeds, NULL, NULL, NULL, array('id' => 'oublog-feeds'), $strfeeds);
}

print '</div>';

// Print blog posts
echo '<div id="middle-column" class="has-right-column">';
echo '<div id="middle-column" >';

echo $oublogoutput->oublog_print_post($cm, $oublog, $post, $returnurl, $blogtype, $canmanageposts, $canaudit, false);

Expand Down Expand Up @@ -169,11 +141,10 @@
print '</div>';
}
?>
<?php if(trim(format_string($comment->title))!=='') { ?><h2 class="oublog-comment-title"><?php print format_string($comment->title); ?></h2><?php } ?>
<?php if(trim(format_string($comment->title))!=='') { ?><h3 class="oublog-comment-title"><?php print format_string($comment->title); ?></h3><?php } ?>
<div class="oublog-comment-date">
<?php print oublog_date($comment->timeposted); ?>
</div>
<div class="oublog-posted-by"><?php
<div class="oublog-postedby"><?php
if ($comment->userid) {
print get_string('postedby', 'oublog',
'<a href="../../user/view.php?id=' . $comment->userid .
Expand All @@ -190,7 +161,7 @@
'approvedate' => oublog_date($comment->timeapproved),
'ip' => s($comment->authorip)));
}
?></div>
?></div> </div>
<div class="oublog-comment-content"><?php print format_text($comment->message, FORMAT_MOODLE); ?></div>
<div class="oublog-post-links">
<?php
Expand Down Expand Up @@ -250,14 +221,14 @@

// Title
if(trim(format_string($comment->title))!=='') {
print '<h2 class="oublog-comment-title">' .
print '<h3 class="oublog-comment-title">' .
format_string($comment->title) . '</h2>';
}

// Date and author
print '<div class="oublog-comment-date">' .
oublog_date($comment->timeposted) . ' </div>';
print '<div class="oublog-posted-by">' .
print '<div class="oublog-postedby">' .
get_string('moderated_postername', 'oublog',
s($comment->authorname)) .
($canaudit ? ' (' . s($comment->authorip) . ')' : '') . '</div>';
Expand Down

0 comments on commit dd40395

Please sign in to comment.