Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Page Builder and BUG fixes (bootstrap)
Browse files Browse the repository at this point in the history
Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I332f8f2ea0c317b5171fe9163912c760f6bc2c77
  • Loading branch information
Naomi Guyer authored and agwells committed Jun 15, 2015
1 parent 5fba030 commit 74b5a5e
Show file tree
Hide file tree
Showing 870 changed files with 14,549 additions and 16,173 deletions.
2 changes: 0 additions & 2 deletions htdocs/account/activity/index.php
Expand Up @@ -59,8 +59,6 @@
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
Expand Down
3 changes: 2 additions & 1 deletion htdocs/account/institutions.php
Expand Up @@ -206,7 +206,8 @@ function confirminvite_submit(Pieform $form, $values) {
'defaultvalue' => $USER->studentid,
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('sendrequest'),
),
)
Expand Down
7 changes: 3 additions & 4 deletions htdocs/admin/extensions/iframesites.php
Expand Up @@ -101,10 +101,9 @@
'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'),
),
),
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/users/search.php
Expand Up @@ -60,7 +60,7 @@
'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,
Expand All @@ -77,7 +77,7 @@
$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);

Expand Down
4 changes: 3 additions & 1 deletion htdocs/artefact/annotation/lib.php
Expand Up @@ -1066,7 +1066,7 @@ public static function add_annotation_feedback_form($defaultprivate=false, $mode
$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,
Expand All @@ -1092,6 +1092,7 @@ public static function add_annotation_feedback_form($defaultprivate=false, $mode
}
$form['elements']['message'] = array(
'type' => 'wysiwyg',
'class' => 'pt0',
'title' => get_string('Annotationfeedback', 'artefact.annotation'),
'rows' => 5,
'cols' => 80,
Expand Down Expand Up @@ -1131,6 +1132,7 @@ public static function add_annotation_feedback_form($defaultprivate=false, $mode
}
$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),
);
Expand Down
2 changes: 0 additions & 2 deletions htdocs/artefact/artefact.php
Expand Up @@ -148,8 +148,6 @@

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()) {
Expand Down
32 changes: 10 additions & 22 deletions htdocs/artefact/blog/blocktype/blog/lib.php
Expand Up @@ -38,6 +38,16 @@ public static function get_categories() {
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');
Expand Down Expand Up @@ -201,28 +211,6 @@ public static function artefactchooser_element($default=null) {
);
}

/**
* 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';
}
Expand Down
30 changes: 17 additions & 13 deletions htdocs/artefact/blog/lib.php
Expand Up @@ -72,6 +72,7 @@ public static function block_advanced_options_element($configdata, $artefacttype
return array(
'type' => 'fieldset',
'name' => 'advanced',
'class' => 'first last',
'collapsible' => true,
'collapsed' => false,
'legend' => get_string('moreoptions', 'artefact.blog'),
Expand Down Expand Up @@ -445,12 +446,13 @@ public static function delete_form($id, $title = '') {
'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'),
),
),
));
Expand Down Expand Up @@ -942,17 +944,17 @@ public static function changepoststatus_form($id, $published = null) {
$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',
Expand All @@ -962,10 +964,10 @@ public static function changepoststatus_form($id, $published = null) {
'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,
),
),
));
Expand All @@ -978,19 +980,21 @@ public static function delete_form($id, $title = '') {
'successcallback' => 'delete_submit',
'jsform' => true,
'jssuccesscallback' => 'delete_success',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-as-button pull-left',
'elements' => array(
'delete' => array(
'type' => 'hidden',
'value' => $id,
'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>',
),
),
));
Expand Down
1 change: 0 additions & 1 deletion htdocs/artefact/blog/post.php
Expand Up @@ -127,7 +127,6 @@
'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,
Expand Down
8 changes: 5 additions & 3 deletions htdocs/artefact/blog/view/index.php
Expand Up @@ -85,17 +85,19 @@
$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) {
Expand Down
Expand Up @@ -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.';
12 changes: 9 additions & 3 deletions htdocs/artefact/comment/blocktype/comment/lib.php
Expand Up @@ -22,6 +22,7 @@ public static function single_only() {
}

public static function get_title() {

return get_string('title', 'blocktype.comment/comment');
}

Expand All @@ -40,9 +41,7 @@ public static function get_viewtypes() {
public static function render_instance(BlockInstance $instance, $editing=false) {
global $USER;

if ($editing) {
return get_string('ineditordescription1', 'blocktype.comment/comment');
}

// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
Expand Down Expand Up @@ -80,6 +79,13 @@ public static function render_instance(BlockInstance $instance, $editing=false)
$smarty->assign('enablecomments', 1);
$smarty->assign('addfeedbackpopup', $addfeedbackpopup);
}

if ($editing) {
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
}



$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/artefact/comment/edit.php
Expand Up @@ -180,8 +180,8 @@ function edit_comment_notify($view, $author, $owner) {
activity_occurred('maharamessage', $data);
}

$stylesheets = array('style/jquery.rating.css');
$smarty = smarty(array('jquery.rating'), array(), array(), array('stylesheets' => $stylesheets));

$smarty = smarty(array(), array(), array(), array());
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('strdescription', get_string('editcommentdescription', 'artefact.comment', $maxage));
$smarty->assign('form', $form);
Expand Down
29 changes: 16 additions & 13 deletions htdocs/artefact/comment/lib.php
Expand Up @@ -733,7 +733,6 @@ public static function add_comment_form($defaultprivate=false, $moderate=false)
$form = array(
'name' => 'add_feedback_form',
'method' => 'post',
'class' => 'js-hidden',
'plugintype' => 'artefact',
'pluginname' => 'comment',
'jsform' => true,
Expand Down Expand Up @@ -797,39 +796,43 @@ public static function add_comment_form($defaultprivate=false, $moderate=false)
}
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'value' => array(get_string('placefeedback', 'artefact.comment'), get_string('cancel')),
'class' => 'btn btn-default',
'value' => array(get_string('Comment', 'artefact.comment'), get_string('cancel')),
);
return $form;
}

public static function make_public_form($id) {
return array(
'name' => 'make_public',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-as-button',
'elements' => array(
'comment' => array('type' => 'hidden', 'value' => $id),
'submit' => array(
'type' => 'submit',
'class' => 'quiet',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-link btn-xs',
'name' => 'make_public_submit',
'value' => get_string('makepublic', 'artefact.comment'),
'value' => '<span class="fa fa-lock text-default prs"></span>' . get_string('makepublic', 'artefact.comment'),
),
),
);
}

public static function delete_comment_form($id) {
global $THEME;
global $THEME;
return array(
'name' => 'delete_comment',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-as-button',
'elements' => array(
'comment' => array('type' => 'hidden', 'value' => $id),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_image_url('btn_deleteremove'),
'value' => get_string('delete'),
'elementtitle' => get_string('delete'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-link btn-sm',
'value' => '<span class="fa fa-trash fa-lg text-danger"></span> <span class="sr-only">' . get_string('delete') . '</span>',
'confirm' => get_string('reallydeletethiscomment', 'artefact.comment'),
'name' => 'delete_comment_submit',
),
Expand Down Expand Up @@ -906,7 +909,7 @@ public static function get_config_options() {
return array(
'name' => 'commentconfig',
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}

Expand Down

0 comments on commit 74b5a5e

Please sign in to comment.