Skip to content

Commit aff3473

Browse files
committed
If a page is a user page and in the TOC, was crashing Dashboot's Users tab
1 parent 9b879be commit aff3473

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

system/application/controllers/api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* @abstract This controller dispatches authentication requests and database updates received via POST
2424
* @return On success returns RDF-JSON; error messages are sent as HTTP response codes
2525
* @author John Bell w/ Craig Dietrich
26-
* @version 1.2
26+
* @version 1.3
2727
*/
2828

2929
Class Api extends CI_Controller {
@@ -708,7 +708,7 @@ private function _payload_to_auth_data() {
708708
// Lens JSON
709709
} elseif (isset($json[0]['urn']) && 'urn:scalar:lens:' == substr($json[0]['urn'], 0, 16)) {
710710
$_POST['native'] = 'true';
711-
$_POST['action'] = 'ADD';
711+
$_POST['action'] = 'RELATE';
712712
}
713713

714714
}

system/application/libraries/RDF_Object.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ protected function _book_by_ref(&$return, $settings) {
293293
// Users
294294
foreach ($settings['users'] as $row) {
295295
if ($settings['u_all']==self::USERS_LISTED && !$row->list_in_index) continue;
296-
$return[$settings['base_uri'].'users/'.$row->user_id] = $CI->users->rdf($row);
296+
$this->_safely_write_rdf($return, $settings['base_uri'].'users/'.$row->user_id, $CI->users->rdf($row));
297297
}
298298

299299
// Table of contents nodes
300300
foreach ($toc_content as $row) {
301301
foreach ($row->versions as $version) {
302302
$row->has_version[] = $settings['base_uri'].$row->slug.'.'.$version->version_num;
303303
}
304-
$return[$settings['base_uri'].$row->slug] = $CI->pages->rdf($row, $settings['base_uri']);
304+
$this->_safely_write_rdf($return, $settings['base_uri'].$row->slug, $CI->pages->rdf($row, $settings['base_uri']));
305305
foreach ($row->versions as $version) {
306306
$return[$settings['base_uri'].$row->slug.'.'.$version->version_num] = $CI->versions->rdf($version, $settings['base_uri']);
307307
}

system/application/views/melons/cantaloupe/users.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<?php endif; ?>
1313
<?php
1414
if (!empty($book_user->url)) {
15-
$this->template->add_js('$(document).ready(function(){$(\'header h1[property="dcterms:title"]:first\').append(\'<a href="'.$book_user->url.'" class="btn btn-primary btn-sm" style="float:right;margin-top:10px;">Homepage</a>\');});','embed');
15+
$this->template->add_js('$(document).ready(function(){$(\'header h1[property="dcterms:title"]:first\').before(\'<a href="'.$book_user->url.'" class="btn btn-primary" style="float:right;margin-top:10px;margin-right:7.2rem;">'.$book_user->fullname.'\\\'s Homepage</a>\');});','embed');
1616
}
1717
$content = (isset($page->version_index)) ? $page->versions[0]->content : null;
1818
if (!empty($content)) {

0 commit comments

Comments
 (0)