19 define(
"TITLE_core_debug_menus", _(
"Debug Menus"));
27 function __construct()
29 $this->Name =
"debug-menus";
30 $this->Title = TITLE_core_debug_menus;
31 $this->MenuList =
"Help::Debug::Debug Menus";
33 parent::__construct();
44 if ($this->
State != PLUGIN_STATE_VALID) {
48 foreach($this->Dependency as $key => $val)
50 $id = plugin_find_id($val);
57 if ($FullMenuDebug == 2)
59 $_SESSION[
'fullmenudebug'] = 1;
61 if ($FullMenuDebug == 1)
63 $_SESSION[
'fullmenudebug'] = 0;
67 $this->
State = PLUGIN_STATE_READY;
69 if ($this->MenuList !==
"")
71 menu_insert(
"Main::" . $this->MenuList,$this->MenuOrder,$this->Name,$this->MenuTarget);
87 $V .=
"<li>" . htmlentities($M->Name);
88 $V .=
" (" . htmlentities($M->Order);
89 $V .=
" -- " . htmlentities($M->URI);
90 $V .=
" @ " . htmlentities($M->Target);
92 if (!empty($M->SubMenu)) {
106 if ($this->
State != PLUGIN_STATE_READY)
110 if ($this->OutputToStdout && $this->OutputType==
"Text") {
115 if ($this->OutputType==
'HTML')
119 if (!$this->OutputToStdout)
121 $this->vars[
'content'] = $output;
137 if ($FullMenuDebug == 2)
139 $text = _(
"Full debug ENABLED!");
140 $text1 = _(
"Now view any page.");
141 $V .=
"<b>$text</b> $text1<P>\n";
143 if ($FullMenuDebug == 1)
145 $text = _(
"Full debug disabled!");
146 $text1 = _(
"Now view any page.");
147 $V .=
"<b>$text</b> $text1<P>\n";
149 $text = _(
"This developer tool lists all items in the menu structure.");
151 $text = _(
"Since some menu inserts are conditional, not everything may appear here (the conditions may not lead to the insertion).");
153 $text = _(
"Fully-debugged menus show the full menu path and order number");
154 $text1 = _(
"in the menu");
155 $V .=
"$text <i>$text1</i>.\n";
157 $text = _(
"The full debugging is restricted to");
159 $text2 = _(
" login session. (Nobody else will see it.)\n");
160 $V .=
"<li>$text <b>$text1</b>$text2";
161 $text = _(
"Full debugging shows the full menu path for each menu\n");
163 $text = _(
"and the order is included in parenthesis.");
165 $text = _(
"However, menus that use HTML instead of text will");
167 $text2 = _(
"show the full path.\n");
168 $V .=
"$text <i>$text1</i>$text2";
169 $text = _(
"To disable full debugging, return here and unselect the option.\n");
173 $V .=
"<form method='post'>\n";
174 if (@$_SESSION[
'fullmenudebug'] == 1)
176 $V .=
"<input type='hidden' name='fullmenu' value='1'>";
177 $text = _(
"Disable Full Debug");
178 $V .=
"<input type='submit' value='$text!'>";
182 $V .=
"<input type='hidden' name='fullmenu' value='2'>";
183 $text = _(
"Enable Full Debug");
184 $V .=
"<input type='submit' value='$text!'>";
191 $V .= htmlentities(print_r($MenuList,1));
199 $NewPlugin->Initialize();
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
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...