Created
February 8, 2010 18:52
-
-
Save igorw/298451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| interface activity_item { | |
| public function get_time(); | |
| public function get_message(); | |
| public function get_row(); // assoc array containing time, lang, args | |
| } | |
| class default_activity_item implements activity_item { | |
| public function __construct($time, $lang, $args) { | |
| $this->time = $time; | |
| $this->lang = $lang; | |
| $this->args = $args; | |
| } | |
| public function get_time() { | |
| return $this->time; | |
| } | |
| public function get_message() { | |
| return vsprintf(registry::$lang[$this->lang], $this->args); | |
| } | |
| public function get_row() { | |
| return array('time' => $this->time, 'lang' => $this->lang, 'args' => serialize($this->args)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment