예제 #1
0
 function __construct($id)
 {
     $this->note = Note::load(array('id' => $id));
     if (!$this->note) {
         error_exit("That note does not exist");
     }
     $this->note->load_creator();
     note_add_to_menu($this->note);
 }
예제 #2
0
파일: index.php 프로젝트: jcartledge/notes
function update_note($title)
{
    Note::save($title, $_POST['note']);
    if (!$GLOBALS['ajax']) {
        return view_note($title);
    }
    $note = Note::load($title);
    echo $note->note;
}
예제 #3
0
파일: Note.php 프로젝트: hutchike/notex
 public function data_for($url)
 {
     load_models('Note');
     $url = preg_replace('/\\.\\w+$/', '', $url);
     $note = new Note(array('url' => $url));
     return $note->load() ? $note->to_text() : NULL;
 }