8 define(
"TITLE_core_debug_menus", _(
"Debug Menus"));
18 $this->Name =
"debug-menus";
19 $this->Title = TITLE_core_debug_menus;
20 $this->MenuList =
"Help::Debug::Debug Menus";
22 parent::__construct();
33 if ($this->
State != PLUGIN_STATE_VALID) {
37 foreach($this->Dependency as $key => $val)
39 $id = plugin_find_id($val);
46 if ($FullMenuDebug == 2)
48 $_SESSION[
'fullmenudebug'] = 1;
50 if ($FullMenuDebug == 1)
52 $_SESSION[
'fullmenudebug'] = 0;
56 $this->
State = PLUGIN_STATE_READY;
58 if ($this->MenuList !==
"")
60 menu_insert(
"Main::" . $this->MenuList,$this->MenuOrder,$this->Name,$this->MenuTarget);
76 $V .=
"<li>" . htmlentities($M->Name);
77 $V .=
" (" . htmlentities($M->Order);
78 $V .=
" -- " . htmlentities($M->URI);
79 $V .=
" @ " . htmlentities($M->Target);
81 if (!empty($M->SubMenu)) {
95 if ($this->
State != PLUGIN_STATE_READY)
99 if ($this->OutputToStdout && $this->OutputType==
"Text") {
104 if ($this->OutputType==
'HTML')
108 if (!$this->OutputToStdout)
110 $this->vars[
'content'] = $output;
126 if ($FullMenuDebug == 2)
128 $text = _(
"Full debug ENABLED!");
129 $text1 = _(
"Now view any page.");
130 $V .=
"<b>$text</b> $text1<P>\n";
132 if ($FullMenuDebug == 1)
134 $text = _(
"Full debug disabled!");
135 $text1 = _(
"Now view any page.");
136 $V .=
"<b>$text</b> $text1<P>\n";
138 $text = _(
"This developer tool lists all items in the menu structure.");
140 $text = _(
"Since some menu inserts are conditional, not everything may appear here (the conditions may not lead to the insertion).");
142 $text = _(
"Fully-debugged menus show the full menu path and order number");
143 $text1 = _(
"in the menu");
144 $V .=
"$text <i>$text1</i>.\n";
146 $text = _(
"The full debugging is restricted to");
148 $text2 = _(
" login session. (Nobody else will see it.)\n");
149 $V .=
"<li>$text <b>$text1</b>$text2";
150 $text = _(
"Full debugging shows the full menu path for each menu\n");
152 $text = _(
"and the order is included in parenthesis.");
154 $text = _(
"However, menus that use HTML instead of text will");
156 $text2 = _(
"show the full path.\n");
157 $V .=
"$text <i>$text1</i>$text2";
158 $text = _(
"To disable full debugging, return here and unselect the option.\n");
162 $V .=
"<form method='post'>\n";
163 if (@$_SESSION[
'fullmenudebug'] == 1)
165 $V .=
"<input type='hidden' name='fullmenu' value='1'>";
166 $text = _(
"Disable Full Debug");
170 $V .=
"<input type='hidden' name='fullmenu' value='2'>";
171 $text = _(
"Enable Full Debug");
173 $V .=
"<input type='submit' value='$text!'>";
179 $V .= htmlentities(print_r(
$MenuList,1));
187 $NewPlugin->Initialize();
This is the Plugin class. All plugins should:
Destroy()
This is a destructor called after the plugin is no longer needed. It should assume that PostInitializ...
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.