]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
add several HOOK_PREFS_TAB_SECTION hook points
[tt-rss.git] / classes / pref / prefs.php
index bb1b44ece899795bcb2660f7a3f0f5779eaab80b..e8926194e6ebf767b8a6ea9761d70cb670e1f0d0 100644 (file)
@@ -366,6 +366,10 @@ class Pref_Prefs extends Handler_Protected {
                        }
                }
 
+               global $pluginhost;
+               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION,
+                       "hook_prefs_tab_section", "prefPrefsAuth");
+
                print "</div>"; #pane
 
                print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"".__('Preferences')."\">";
@@ -594,6 +598,10 @@ class Pref_Prefs extends Handler_Protected {
 
                print "</table>";
 
+               global $pluginhost;
+               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION,
+                       "hook_prefs_tab_section", "prefPrefsPrefsInside");
+
                print '</div>'; # inside pane
                print '<div dojoType="dijit.layout.ContentPane" region="bottom">';
 
@@ -621,6 +629,10 @@ class Pref_Prefs extends Handler_Protected {
                                <label for='prefs_show_advanced'>" .
                                __("Show additional preferences") . "</label>";
 
+               global $pluginhost;
+               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION,
+                       "hook_prefs_tab_section", "prefPrefsPrefsOutside");
+
                print "</form>";
                print '</div>'; # inner pane
                print '</div>'; # border container
@@ -655,7 +667,7 @@ class Pref_Prefs extends Handler_Protected {
                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%'>";
+               print "<table width='100%' class='prefPluginsList'>";
 
                print "<tr><td colspan='4'><h3>".__("System plugins")."</h3></td></tr>";
 
@@ -670,12 +682,12 @@ class Pref_Prefs extends Handler_Protected {
                $user_enabled = array_map("trim", explode(",", get_pref($this->link, "_ENABLED_PLUGINS")));
 
                $tmppluginhost = new PluginHost($link);
-               $tmppluginhost->load_all();
+               $tmppluginhost->load_all($tmppluginhost::KIND_ALL);
 
                foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
-                       $about = $plugin->_about();
+                       $about = $plugin->about();
 
-                       if ($about[3]) {
+                       if ($about[3] && strpos($name, "example") === FALSE) {
                                if (in_array($name, $system_enabled)) {
                                        $checked = "checked='1'";
                                } else {
@@ -709,29 +721,32 @@ class Pref_Prefs extends Handler_Protected {
 
 
                foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
-                       $about = $plugin->_about();
+                       $about = $plugin->about();
 
-                       if (!$about[3]) {
+                       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>";
+                               print "<tr class='$rowclass'>";
 
                                print "<td align='center'><input id='FPCHK-$name' name='plugins[]' value='$name' onclick='toggleSelectRow2(this);'
                                        dojoType=\"dijit.form.CheckBox\" $checked $disabled
                                        type=\"checkbox\"></td>";
 
-                               print "<td>$name</td>";
-                               print "<td>" . htmlspecialchars($about[1]) . "</td>";
+                               print "<td><label for='FPCHK-$name'>$name</label></td>";
+                               print "<td><label for='FPCHK-$name'>" . htmlspecialchars($about[1]) . "</label></td>";
                                print "<td>" . htmlspecialchars(sprintf("%.2f", $about[0])) . "</td>";
                                print "<td>" . htmlspecialchars($about[2]) . "</td>";