-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
58 lines (48 loc) · 1.54 KB
/
index.php
File metadata and controls
58 lines (48 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Notes plugin for Wolf CMS <http://project79.net/projects/notes>
* Available on Github <https://github.com/project79>
*
* Simple notes for admin area.
*
* @author Dejan Andjelkovic <dejan79@gmail.com>
* @package Wolf
* @subpackage plugin.notes
* @version 0.0.8
* @licence http://www.gnu.org/licenses/gpl.html
* @copyright http://project79.net, 2010-2012
*/
if (!defined('IN_CMS')) { exit(); }
Plugin::setInfos(array(
'id' => 'notes',
'title' => __('Notes'),
'description' => __('Have your notes always by your side.'),
'version' => '0.1.0',
'license' => 'GPL',
'author' => 'Dejan Andjelkovic',
'website' => 'http://www.project79.net/projects/notes',
'update_url' => 'http://www.project79.net/plugin-versions.xml',
'require_wolf_version' => '0.7.3'
));
// Show tab
Plugin::addController('notes', __('Notes'), 'admin_view', true);
// Load Notes model
AutoLoader::addFile('Notes', CORE_ROOT.'/plugins/notes/models/Notes.php');
// Show all notes in frontend
function showallnotes(){
$notes = Notes::findAllFrom('Notes', 'id=id ORDER BY created_on DESC');
echo '<div id="show-all-notes">';
foreach ($notes as $n) {
echo '<h3>'.$n->getTitle().'</h3>';
echo $n->frontendContent();
}
echo '</div>';
}
// Show note by $id
function shownotebyid($id) {
$note = Notes::findByIdFrom('Notes', $id);
echo '<div id="show-note-by-id">';
echo '<h3>'.$note->getTitle().'</h3>';
echo $note->frontendContent();
echo '</div>';
}