Commit 74b5a5e0 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

Page Builder and BUG fixes (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I332f8f2ea0c317b5171fe9163912c760f6bc2c77
parent 5fba0303
......@@ -59,8 +59,6 @@ if (!isset($options[$type])) {
require_once('activity.php');
$activitylist = activitylist_html($type);
$star = json_encode($THEME->get_image_url('star'));
$readicon = json_encode($THEME->get_image_url('readusermessage'));
$strread = json_encode(get_string('read', 'activity'));
$javascript = <<<JAVASCRIPT
......
......@@ -206,7 +206,8 @@ if (!empty($institutions) &&
'defaultvalue' => $USER->studentid,
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('sendrequest'),
),
)
......
......@@ -101,10 +101,9 @@ foreach ($iframesources as $url => $name) {
'value' => $url,
),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_image_url('btn_deleteremove'),
'alt' => get_string('deletespecific', 'mahara', $name),
'elementtitle' => get_string('delete'),
'type' => 'submit',
'value' => get_string('deletespecific', 'mahara', $name),
'confirm' => get_string('confirmdeletemenuitem', 'admin'),
),
),
......
......@@ -60,7 +60,7 @@ $calendar = array(
'tabindex' => false,
'type' => 'calendar',
'title' => get_string('date'),
'imagefile' => $THEME->get_image_url('btn_calendar'),
'imagefile' => $THEME->get_url('images/calendar.png'),
'defaultvalue' => strtotime($search->loggedindate),
'caloptions' => array(
'showsTime' => true,
......@@ -77,7 +77,7 @@ $calendarform = new Pieform(array(
$calendarform->include_plugin('element', 'calendar');
$loggedindate = pieform_element_calendar($calendarform, $calendar);
$searchParams = $search; //store search as it's about to change
$searchParams = $search; //store search as it's about to change
list($html, $columns, $pagination, $search) = build_admin_user_search_results($search, $offset, $limit);
......
......@@ -1066,7 +1066,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
$form = array(
'name' => 'add_annotation_feedback_form_' . $blockid,
'method' => 'post',
'class' => 'js-hidden hidden add_annotation_feedback_form',
'class' => 'add_annotation_feedback_form',
'plugintype' => 'artefact',
'pluginname' => 'annotation',
'jsform' => true,
......@@ -1092,6 +1092,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
}
$form['elements']['message'] = array(
'type' => 'wysiwyg',
'class' => 'pt0',
'title' => get_string('Annotationfeedback', 'artefact.annotation'),
'rows' => 5,
'cols' => 80,
......@@ -1131,6 +1132,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
}
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('placeannotationfeedback', 'artefact.annotation'), get_string('cancel')),
'goto' => '/' . $view->get_url(false),
);
......
......@@ -148,8 +148,6 @@ $extrastylesheets = array('style/views.css');
if ($artefact->get('allowcomments') && ( $USER->is_logged_in() || (!$USER->is_logged_in() && get_config('anonymouscomments')))) {
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments')));
$extrastylesheets[] = 'style/jquery.rating.css';
$javascript[] = 'jquery.rating';
}
$objectionform = pieform(objection_form());
if ($notrudeform = notrude_form()) {
......
......@@ -38,6 +38,16 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return array('blog' => 10000);
}
//{$WWWROOT}artefact/blog/post.php?blog={$blogid
public static function get_link(BlockInstance $instance) {
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
$data = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $configdata['artefactid'] . '&view=' . $instance->get('view');
return sanitize_url($data);
}
}
public static function render_instance(BlockInstance $instance, $editing=false) {
global $exporter;
$configdata = $instance->get('configdata');
......@@ -201,28 +211,6 @@ class PluginBlocktypeBlog extends PluginBlocktype {
);
}
/**
* Optional method. If specified, allows the blocktype class to munge the
* artefactchooser element data before it's templated
*/
//public static function artefactchooser_get_element_data($artefact) {
// static $blognames = array();
// if (!isset($blognames[$artefact->parent])) {
// $blognames[$artefact->parent] = get_field('artefact', 'title', 'id', $artefact->parent);
// }
// $artefact->blog = $blognames[$artefact->parent];
// $ellipsis = '';
// $artefact->description = trim(strip_tags($artefact->description));
// if (strlen($artefact->description) > 100) {
// $ellipsis = '…';
// }
// $artefact->description = substr($artefact->description, 0, 100) . $ellipsis;
// return $artefact;
//}
public static function default_copy_type() {
return 'nocopy';
}
......
......@@ -72,6 +72,7 @@ class PluginArtefactBlog extends PluginArtefact {
return array(
'type' => 'fieldset',
'name' => 'advanced',
'class' => 'first last',
'collapsible' => true,
'collapsed' => false,
'legend' => get_string('moreoptions', 'artefact.blog'),
......@@ -445,12 +446,13 @@ class ArtefactTypeBlog extends ArtefactType {
'value' => $id,
),
'submit' => array(
'type' => 'submit',
'class' => 'input-as-icon icon-trash',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default btn-sm',
'alt' => get_string('deletespecific', 'mahara', $title),
'elementtitle' => get_string('delete'),
'confirm' => $confirm,
'value' => get_string('delete'),
'value' => '<span class="fa fa-trash text-danger prs"></span> ' .get_string('delete'),
),
),
));
......@@ -942,17 +944,17 @@ class ArtefactTypeBlogPost extends ArtefactType {
$published = $post->published;
}
if ($published) {
$strchangepoststatus = get_string('unpublish', 'artefact.blog');
$strchangepoststatus = '<span class="prs fa fa-times text-danger"></span> ' .get_string('unpublish', 'artefact.blog');
}
else {
$strchangepoststatus = get_string('publish', 'artefact.blog');
$strchangepoststatus = '<span class="prs fa fa-check text-success"></span> ' . get_string('publish', 'artefact.blog');
}
return pieform(array(
'name' => 'changepoststatus_' . $id,
'jssuccesscallback' => 'changepoststatus_success',
'successcallback' => 'changepoststatus_submit',
'jsform' => true,
'renderer' => 'oneline',
'renderer' => 'div',
'elements' => array(
'changepoststatus' => array(
'type' => 'hidden',
......@@ -962,10 +964,10 @@ class ArtefactTypeBlogPost extends ArtefactType {
'type' => 'hidden',
'value' => $published,
),'submit' => array(
'type' => 'submit',
'class' => 'publish btn btn-success btn-xs',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default btn-sm publish',
'value' => $strchangepoststatus,
'help' => true,
),
),
));
......@@ -978,7 +980,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
'successcallback' => 'delete_submit',
'jsform' => true,
'jssuccesscallback' => 'delete_success',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-as-button pull-left',
'elements' => array(
'delete' => array(
'type' => 'hidden',
......@@ -986,11 +989,12 @@ class ArtefactTypeBlogPost extends ArtefactType {
'help' => true,
),
'submit' => array(
'type' => 'submit',
'class' => 'input-as-icon icon-trash',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default btn-sm',
'elementtitle' => get_string('delete'),
'confirm' => get_string('deleteblogpost?', 'artefact.blog'),
'value' => get_string('delete'),
'value' => '<span class="fa fa-trash text-danger"></span><span class="btn-title pls">' .get_string('delete') . '</span>',
),
),
));
......
......@@ -127,7 +127,6 @@ $form = pieform(array(
'licensing_advanced' => license_form_el_advanced(isset($blogpostobj) ? $blogpostobj : null),
'filebrowser' => array(
'type' => 'filebrowser',
'class' => 'filebrowser',
'title' => get_string('attachments', 'artefact.blog'),
'folder' => $folder,
'highlight' => $highlight,
......
......@@ -85,17 +85,19 @@ $strchangepoststatuspublish = json_encode(get_string('publish', 'artefact.blog')
$strchangepoststatusunpublish = json_encode(get_string('unpublish', 'artefact.blog'));
$js = <<<EOF
function changepoststatus_success(form, data) {
if ($('changepoststatus_' + data.id + '_currentpoststatus').value == 0) {
console.log($('changepoststatus_' + data.id + '_currentpoststatus'));
if ($('changepoststatus_' + data.id + '_currentpoststatus').value === "0") {
removeElementClass($('posttitle_' + data.id), 'draft');
addElementClass($('posttitle_' + data.id), 'published');
$('poststatus' + data.id).innerHTML = {$strpublished};
$('changepoststatus_' + data.id + '_submit').value = {$strchangepoststatusunpublish};
$('changepoststatus_' + data.id + '_submit').innerHTML = '<span class="prs fa fa-times text-danger"></span> ' + {$strchangepoststatusunpublish};
}
else {
removeElementClass($('posttitle_' + data.id), 'published');
addElementClass($('posttitle_' + data.id), 'draft');
$('poststatus' + data.id).innerHTML = {$strdraft};
$('changepoststatus_' + data.id + '_submit').value = {$strchangepoststatuspublish};
$('changepoststatus_' + data.id + '_submit').innerHTML = '<span class="prs fa fa-check text-success"></span>' + {$strchangepoststatuspublish};
}
}
function delete_success(form, data) {
......
......@@ -11,6 +11,6 @@
defined('INTERNAL') || die();
$string['title'] = 'Feedback';
$string['description'] = 'A block to display feedback';
$string['ineditordescription1'] = 'Feedback for this page will be displayed here rather than at the bottom of the page.';
$string['title'] = 'Comments';
$string['description'] = 'A block to display comments';
$string['ineditordescription1'] = 'Comments for this page will be displayed here rather than at the bottom of the page.';
......@@ -22,6 +22,7 @@ class PluginBlocktypeComment extends SystemBlocktype {
}
public static function get_title() {
return get_string('title', 'blocktype.comment/comment');
}
......@@ -40,9 +41,7 @@ class PluginBlocktypeComment extends SystemBlocktype {
public static function render_instance(BlockInstance $instance, $editing=false) {
global $USER;
if ($editing) {
return get_string('ineditordescription1', 'blocktype.comment/comment');
}