const HOOK_ARTICLE_BUTTON = 1;
const HOOK_ARTICLE_FILTER = 2;
+ const HOOK_PREFS_TAB = 3;
+ const HOOK_PREFS_SECTION = 4;
function __construct($link) {
$this->link = $link;
return $this->plugins[$name];
}
+ function run_hooks($type, $method, $args) {
+ foreach ($this->get_hooks($type) as $hook) {
+ $hook->$method($args);
+ }
+ }
+
function add_hook($type, $sender) {
if (!is_array($this->hooks[$type])) {
$this->hooks[$type] = array();
print "</div>"; #pane
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefFeeds");
+
print "</div>"; #container
}
</div>";
print "</div>"; #pane
+
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefFilters");
+
print "</div>"; #container
}
print "</table>";
print "</div>"; #pane
+
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefInstances");
+
print "</div>"; #container
}
</div>";
print "</div>"; #pane
+
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefLabels");
+
print "</div>"; #container
}
print "</div>"; #pane
}
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefPrefs");
+
print "</div>"; #container
}
}
print "</div>"; #pane
+
+ global $pluginhost;
+ $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+ "hook_prefs_tab", "prefUsers");
+
print "</div>"; #container
}
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
- <script type="text/javascript" charset="utf-8" src="js/functions.js?<?php echo $dt_add ?>"></script>
- <script type="text/javascript" charset="utf-8" src="js/deprecated.js?<?php echo $dt_add ?>"></script>
- <script type="text/javascript" charset="utf-8" src="js/prefs.js?<?php echo $dt_add ?>"></script>
+ <script type="text/javascript">
+ <?php
+ require 'lib/jsmin.php';
+
+ global $pluginhost;
+
+ foreach ($pluginhost->get_plugins() as $n => $p) {
+ if (method_exists($p, "get_prefs_js")) {
+ echo JSMin::minify($p->get_prefs_js());
+ }
+ }
+
+ foreach (array("functions", "deprecated", "prefs") as $js) {
+ if (!isset($_GET['debug'])) {
+ echo JSMin::minify(file_get_contents("js/$js.js"));
+ } else {
+ echo file_get_contents("js/$js.js");
+ }
+ }
+ ?>
+ </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>