crumbs.comment.inc in Crumbs, the Breadcrumbs suite 7
File
plugins/crumbs.comment.inc
View source
<?php
function comment_crumbs_plugins($api) {
$api
->monoPlugin('reply');
$api
->monoPlugin('comment');
$api
->monoPlugin('skip');
}
class comment_CrumbsMonoPlugin_reply implements crumbs_MonoPlugin {
function describe($api) {
return t('Make node/% the parent for comment/reply/%');
}
function findParent__comment_reply_x($path, $item) {
$nid = $item['fragments'][2];
return 'node/' . $nid;
}
}
class comment_CrumbsMonoPlugin_comment implements crumbs_MonoPlugin {
function describe($api) {
return t('Make node/% the parent for comment/%');
}
function findParent__comment_x($path, $item) {
$comment = comment_load($item['map'][1]);
if ($comment && $comment->nid) {
return 'node/' . $comment->nid;
}
}
}
class comment_CrumbsMonoPlugin_skip implements crumbs_MonoPlugin {
function describe($api) {
return t('Skip comment/% in the breadcrumb.');
}
function findTitle__comment_x($path, $item) {
return FALSE;
}
}