diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-08-30 10:37:35 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net ; true> | 2011-08-30 10:37:35 -0700 |
commit | 558684e32769d9dbd0d27a6feb3bbb9cf9aa22d7 (patch) | |
tree | fe3bb494162e238e59a9a2f1b013dfa317e946b8 /htdocs/src | |
parent | 273112695da89b8d0d6ac54a5f4f068969c0bd70 (diff) |
Abstracted source name code and added a source name listing to the moderation index. (Eventum #33).HEADmaster
Diffstat (limited to 'htdocs/src')
-rw-r--r-- | htdocs/src/Post.inc.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/htdocs/src/Post.inc.php b/htdocs/src/Post.inc.php index 906778e..eaad6b3 100644 --- a/htdocs/src/Post.inc.php +++ b/htdocs/src/Post.inc.php @@ -155,6 +155,22 @@ class Post { } } + public function getSourceName() { + $source = $this->getSource(); + + if ($source !== false) { + // Get source from source id + $sourceObj = Source::getById($source); + $source = $sourceObj->getName(); + + } else { + // Get other + $source = "Other: " . $post->getOtherSource(); + } + + return $source; + } + public function getOtherSource() { return $this->info['reason']; } |