forked from ThinkUpLLC/ThinkUp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
class.Plugin.php
executable file
·49 lines (43 loc) · 1.21 KB
/
class.Plugin.php
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
<?php
class Plugin {
var $id;
var $name;
var $folder_name;
var $description;
var $author;
var $homepage;
var $version;
var $is_active = false;
function Plugin($val) {
$this->id = $val["id"];
$this->name = $val["name"];
$this->folder_name = $val["folder_name"];
$this->description = $val['description'];
$this->author = $val['author'];
$this->homepage = $val['homepage'];
$this->version = $val['version'];
if ($val['is_active'] == 1) {
$this->is_active = true;
}
}
}
class PluginDAO extends MySQLDAO {
public function getAllPlugins($condition = "") {
$q = " SELECT * FROM #prefix#plugins p ";
if ( $condition != "" ) {
$q .= $condition;
}
//echo $q;
$sql_result = $this->executeSQL($q);
$plugins = array();
while ($row = mysql_fetch_assoc($sql_result)) {
$plugins[] = new Plugin($row);
}
mysql_free_result($sql_result);
return $plugins;
}
public function getActivePlugins() {
return $this->getAllPlugins(" WHERE p.is_active = 1");
}
}
?>