本文整理汇总了PHP中PluginHost::get_all方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginHost::get_all方法的具体用法?PHP PluginHost::get_all怎么用?PHP PluginHost::get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginHost
的用法示例。
在下文中一共展示了PluginHost::get_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
//.........这里部分代码省略.........
<label for='prefs_show_advanced'>" .
__("Show additional preferences") . "</label>"; */
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsPrefsOutside");
print "</form>";
print '</div>';
# inner pane
print '</div>';
# border container
print "</div>";
#pane
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Plugins') . "\">";
print "<p>" . __("You will need to reload Tiny Tiny RSS for plugin changes to take effect.") . "</p>";
print_notice(__("Download more plugins at tt-rss.org <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/forum/viewforum.php?f=22\">forums</a> or <a target=\"_blank\" class=\"visibleLink\" href=\"http://tt-rss.org/wiki/Plugins\">wiki</a>."));
print "<form dojoType=\"dijit.form.Form\" id=\"changePluginsForm\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\tevt.preventDefault();\n\t\tif (this.validate()) {\n\t\t\tnotify_progress('Saving data...', true);\n\n\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\tnotify('');\n\t\t\t\t\tif (confirm(__('Selected plugins have been enabled. Reload?'))) {\n\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t}\n\t\t\t} });\n\n\t\t}\n\t\t</script>";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setplugins\">";
print "<table width='100%' class='prefPluginsList'>";
print "<tr><td colspan='4'><h3>" . __("System plugins") . "</h3></td></tr>";
print "<tr class=\"title\">\n\t\t\t\t<td width=\"5%\"> </td>\n\t\t\t\t<td width='10%'>" . __('Plugin') . "</td>\n\t\t\t\t<td width=''>" . __('Description') . "</td>\n\t\t\t\t<td width='5%'>" . __('Version') . "</td>\n\t\t\t\t<td width='10%'>" . __('Author') . "</td></tr>";
$system_enabled = array_map("trim", explode(",", PLUGINS));
$user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
$tmppluginhost = new PluginHost();
$tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"]);
$tmppluginhost->load_data(true);
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
if ($about[3] && strpos($name, "example") === FALSE) {
if (in_array($name, $system_enabled)) {
$checked = "checked='1'";
} else {
$checked = "";
}
print "<tr>";
print "<td align='center'><input disabled='1'\n\t\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" {$checked}\n\t\t\t\t\t\ttype=\"checkbox\"></td>";
$plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
print "<td><label><img src='images/{$plugin_icon}' alt=''> {$name}</label></td>";
print "<td>" . htmlspecialchars($about[1]);
if (@$about[4]) {
print " — <a target=\"_blank\" class=\"visibleLink\"\n\t\t\t\t\t\thref=\"" . htmlspecialchars($about[4]) . "\">" . __("more info") . "</a>";
}
print "</td>";
print "<td>" . htmlspecialchars(sprintf("%.2f", $about[0])) . "</td>";
print "<td>" . htmlspecialchars($about[2]) . "</td>";
if (count($tmppluginhost->get_all($plugin)) > 0) {
if (in_array($name, $system_enabled)) {
print "<td><a href='#' onclick=\"clearPluginData('{$name}')\"\n\t\t\t\t\t\t\tclass='visibleLink'>" . __("Clear data") . "</a></td>";
}
}
print "</tr>";
}
}
print "<tr><td colspan='4'><h3>" . __("User plugins") . "</h3></td></tr>";
print "<tr class=\"title\">\n\t\t\t\t<td width=\"5%\"> </td>\n\t\t\t\t<td width='10%'>" . __('Plugin') . "</td>\n\t\t\t\t<td width=''>" . __('Description') . "</td>\n\t\t\t\t<td width='5%'>" . __('Version') . "</td>\n\t\t\t\t<td width='10%'>" . __('Author') . "</td></tr>";
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
if (!$about[3] && strpos($name, "example") === FALSE) {
if (in_array($name, $system_enabled)) {
$checked = "checked='1'";
$disabled = "disabled='1'";
$rowclass = '';
} else {
if (in_array($name, $user_enabled)) {
$checked = "checked='1'";
$disabled = "";
$rowclass = "Selected";
} else {
$checked = "";
$disabled = "";
$rowclass = '';
}
}
print "<tr class='{$rowclass}'>";
$plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
print "<td align='center'><input id='FPCHK-{$name}' name='plugins[]' value='{$name}' onclick='toggleSelectRow2(this);'\n\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" {$checked} {$disabled}\n\t\t\t\t\ttype=\"checkbox\"></td>";
print "<td><label for='FPCHK-{$name}'><img src='images/{$plugin_icon}' alt=''> {$name}</label></td>";
print "<td><label for='FPCHK-{$name}'>" . htmlspecialchars($about[1]) . "</label>";
if (@$about[4]) {
print " — <a target=\"_blank\" class=\"visibleLink\"\n\t\t\t\t\t\thref=\"" . htmlspecialchars($about[4]) . "\">" . __("more info") . "</a>";
}
print "</td>";
print "<td>" . htmlspecialchars(sprintf("%.2f", $about[0])) . "</td>";
print "<td>" . htmlspecialchars($about[2]) . "</td>";
if (count($tmppluginhost->get_all($plugin)) > 0) {
if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
print "<td><a href='#' onclick=\"clearPluginData('{$name}')\" class='visibleLink'>" . __("Clear data") . "</a></td>";
}
}
print "</tr>";
}
}
print "</table>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Enable selected plugins") . "</button></p>";
print "</form>";
print "</div>";
#pane
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "hook_prefs_tab", "prefPrefs");
print "</div>";
#container
}