Skip to content

Commit

Permalink
Cleanup wording to make consistent. Better attempt to find a label fo…
Browse files Browse the repository at this point in the history
…r records in admin
  • Loading branch information
patrickmj committed Apr 23, 2013
1 parent f65ac13 commit 99e0a2f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
10 changes: 3 additions & 7 deletions helpers/GetComments.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ class Commenting_View_Helper_GetComments extends Zend_View_Helper_Abstract

private function _getRecordId($params)
{

//@TODO: update exhibit-builder handling for 2.0
if(isset($params['module'])) {
switch($params['module']) {
case 'exhibit-builder':
//ExhibitBuilder uses slugs in the params, so need to negotiate around those
//to dig up the record_id and model
if(!empty($params['page_slug'])) {
$page = exhibit_builder_get_current_page();
$id = $page->id;
if(isset($this->exhibit_page)) {
$id = $this->exhibit_page->id;
} else if(!empty($params['item_id'])) {
$id = $params['item_id'];
} else {
$section = exhibit_builder_get_current_section();
$id = $section->id;
}
break;

Expand Down
33 changes: 30 additions & 3 deletions views/admin/comment.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
<?php
$record = get_db()->getTable($comment->record_type)->find($comment->record_id);
$label = metadata($record, array('Dublin Core', 'Title'));
// try hard to dig up a likely label from the metadata or properties
try {
$label = metadata($record, array('Dublin Core', 'Title'));
} catch(BadMethodCallException $e) {

}

if(empty($label)) {
$label = metadata($record, 'name');
try {
$label = metadata($record, 'name');
} catch(InvalidArgumentException $e) {

}
}

if(empty($label)) {
try {
$label = metadata($record, 'title');
} catch(InvalidArgumentException $e) {

}
}

if(empty($label)) {
try {
$label = metadata($record, 'label');
} catch(InvalidArgumentException $e) {

}
}

//sad trombone. couldn't find a label!
if(empty($label)) {
$label = __('Untitled');
$label = __('[Untitled]');
}
?>

Expand Down
2 changes: 1 addition & 1 deletion views/admin/comment/browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a class="small blue button disabled" id="batch-unapprove" >Unapprove</a>
<?php if(get_option('commenting_wpapi_key') != ''): ?>
<a class="small blue button disabled" id="batch-report-spam" onclick="Commenting.batchReportSpam()">Report Spam</a>
<a class="small blue button disabled" id="batch-report-ham" onclick="Commenting.batchReportHam()">Report Ham</a>
<a class="small blue button disabled" id="batch-report-ham" onclick="Commenting.batchReportHam()">Report Not Spam</a>
<?php endif; ?>
<a class="small blue button disabled" id="batch-flag" >Flag</a>
<a class="small blue button disabled" id="batch-unflag" >Unflag</a>
Expand Down
2 changes: 1 addition & 1 deletion views/admin/common/quick-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<li><a href="<?php echo url('commenting/comment/browse', array('approved' => 1)); ?>"><?php echo __('Approved'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('approved' => 0)); ?>"><?php echo __('Needs Approval'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('is_spam' => 1)); ?>"><?php echo __('Spam'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('is_spam' => 0)); ?>"><?php echo __('Ham'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('is_spam' => 0)); ?>"><?php echo __('Not Spam'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('flagged' => 1)); ?>"><?php echo __('Flagged'); ?></a></li>
<li><a href="<?php echo url('commenting/comment/browse', array('flagged' => 0)); ?>"><?php echo __('Not Flagged'); ?></a></li>
</ul>
Expand Down

0 comments on commit 99e0a2f

Please sign in to comment.