64 function getPlugins(
$db,
$lang, $manage)
66 if (isset($manage) && ($manage == 1))
68 $sqlcode =
"WHERE activated='1'";
75 if (!
$res =
$db->query(
"SELECT * FROM {plugins} $sqlcode ORDER by name"))
77 \YAWK\sys::setSyslog(
$db, 31, 1,
"failed to select plugin from database", 0, 0, 0, 0);
78 print \YAWK\alert::draw(
"danger",
"$lang[ERROR]",
"$lang[PLUGIN_DB_ERROR]",
"",
"");
86 while ($row = mysqli_fetch_array(
$res))
89 $this->
name = $row[1];
91 $this->
icon = $row[3];
92 $this->activated = $row[4];
98 if (file_exists(
$folder) ===
true)
101 <td style=\"text-align: center;\"><a href=\"index.php?plugin=$this->name\"><i class=\"$this->icon fa-4x\"></i></a></td>
102 <td><br><a href=\"index.php?plugin=$this->name\"><div>$this->name</div></a></td>
103 <td><br>$this->description</td>
104 <td style=\"text-align: center;\"><br>
105 <a class=\"fa fa-edit\" title=\"" .
$lang[
'EDIT'] .
"\" href=\"index.php?plugin=$this->name\"></a>
112 echo \YAWK\alert::draw(
"warning",
"Fehler!",
"$lang[PLUGIN]: <b>\"$name\"</b> $lang[PLUGIN_FALSE_INSTALLED] <b>system/plugins/$this->name/</b>",
"",
"4800");
132 if (
$res =
$db->query(
"SELECT name FROM {plugins} WHERE id = '" . $pluginId .
"'"))
134 while ($row = mysqli_fetch_row(
$res))
141 \YAWK\sys::setSyslog(
$db, 31, 1,
"failed to get name of plugin $pluginId ", 0, 0, 0, 0);
160 if (
$res =
$db->query(
"SELECT id FROM {plugins} WHERE name ='".$plugin.
"'"))
162 while ($row = mysqli_fetch_row(
$res))
169 \YAWK\sys::setSyslog(
$db, 31, 1,
"failed to get id of plugin $plugin ", 0, 0, 0, 0);
170 return \YAWK\alert::draw(
"danger",
"Error!",
"Could not get id of plugin: ".
$plugin.
"",
"page=plugins",
"4800");
186 static function createPluginPage(
$db, $alias,
$plugin)
188 if (!isset($alias)){ $alias =
''; }
189 if (!isset(
$plugin)){ $alias =
''; }
190 if (!file_exists(
"../content/pages/$alias.php"))
194 $page = new \YAWK\page();
199 \YAWK\sys::setSyslog(
$db, 29, 0,
"created page $alias for plugin $plugin", 0, 0, 0, 0);
204 \YAWK\sys::setSyslog(
$db, 31, 1,
"failed to create page $alias for plugin $plugin - check file and folder permissions!", 0, 0, 0, 0);
210 \YAWK\sys::setSyslog(
$db, 31, 1,
"failed to create page $alias for plugin $plugin - a page with that name still exits. File will not be overwritten.", 0, 0, 0, 0);
print $lang['FILEMAN_UPLOAD']
Handles the Plugin System.
static getNameById($db, $pluginId)
get requested plugin name for given plugin ID
static getIdByName($db, $plugin)
get requested plugin ID by given name
__construct()
plugin constructor.
This class serves methods to create backup from files.