PDA

View Full Version : Administrative and Maintenance Tools - Save & Reload button when editing plugins


Analogpoint
10-02-2007, 10:00 PM
This is a 5 minute modification to the admin cp that adds a Save & Reload button when you're editing a plugin. If you develop plugins/products this can save you a lot of time. I threw this together for my own use, since I've been creating some plugins and products lately. If you find it useful, mark it as installed!

Hopefully this will be obsolete in the next release of vB. I also hope that the devs put more hooks in the ACP to make mods like this easier. :)

To install, just import the product XML file.

http://www.analogpoint.com/static/images/save-and-reload-screenshot.png

DJ XtAzY
10-03-2007, 06:51 PM
very useful, should be default in vb

FreshFroot
10-03-2007, 07:07 PM
ahh this will help.. I always had to go back and forth. Thanks :D

bchertov
10-04-2007, 04:34 AM
I was just thinking today this would be nice! You read my mind! :D
Installed!

yoyoyoyo
10-04-2007, 01:00 PM
thanks - very helpful.

Alphawolf83
10-10-2007, 03:16 PM
Dude, thanks so much for that tiny helper! I've been wondering why this hasnt found its way into vb yet.

Installed and nominated for MOTM. Yeah, seriously. :)

Spinball
06-14-2008, 09:15 PM
Works with 3.7.1 PL1.

BamaStangGuy
07-29-2008, 09:11 PM
This has stopped working as of latest vBulletin

Quarterbore
08-04-2008, 02:29 AM
Thanks a million!

Quarterbore
08-10-2008, 12:24 PM
IS there any chance that a setting could be added so that the resize window setting can be defined. I tried to look at the code a little but I have to work this weekend and it may take me a while to work through this.

I know the HTML code that does the resizing is in here:

<tr valign="top">
<td class="alt1">Plugin PHP Code <dfn>Use this field to enter the PHP code that you would like to be run.</dfn><p><input type="button" unselectable="on" value="Large Edit Box" class="button" style="font-weight:normal" onclick="window.open('textarea.php?dir=ltr&name=phpcode','textpopup','resizable=yes,width=' + (screen.width - (screen.width/10)) + ',height=600');" /></p></td>
<td class="alt1"><div id="ctrl_phpcode"><textarea name="phpcode" id="ta_phpcode_5" class="code" rows="10" cols="45" wrap="virtual" dir="ltr" tabindex="1" title="name=&quot;phpcode&quot;">if ($vbulletin-&gt;options['psar_enable'])
{
function psar_add_button()
{
global $vbulletin, $vbphrase, $psar_started;
if ($psar_started)
{
$contents = ob_get_clean();
$find = '&lt;input type=&quot;reset&quot;';
$button = '&lt;input class=&quot;button&quot; tabindex=&quot;1&quot; name=&quot;return&quot; value=&quot; '.$vbphrase['psar_save_and_reload'].' &quot; accesskey=&quot;s&quot; type=&quot;submit&quot;&gt;';
echo preg_replace(&quot;/$find/&quot;, ' ' . $button . ' ' . $find, $contents);
}
}

function psar_return_to_plugin()
{
global $vbulletin, $psar_redirect_started;
if ($psar_redirect_started)
{
$pluginid = intval($vbulletin-&gt;GPC['pluginid']);
$contents = ob_get_clean();
$contents = str_replace('&quot;plugin.php?', '&quot;plugin.php?do=edit&amp;pluginid='.$pluginid.'&amp;', $contents);
$contents = str_replace('&quot;plugin.php&quot;', '&quot;plugin.php?do=edit&amp;pluginid='.$pluginid.'&quot;', $contents);
echo $contents;
}

}

psar_add_button();
psar_return_to_plugin();
}</textarea><div class="smallfont"><a href="#" onclick="return resize_textarea(1, 'ta_phpcode_5')">Increase Size</a> <a href="#" onclick="return resize_textarea(-1, 'ta_phpcode_5')">Decrease Size</a></div></div></td>
</tr>


I have not found the function for the "resize_textarea" to see if we could use a value larger then "1" for example "7" that would allow the editor window to open 7-steps larger. If that were the case, then perhaps the save and reload could have a configuration setting so the window is always saved to some desired width.

Just a suggestion and I may try to figure it out although I rarely make code changes in the vBEditor anyways (I like simple old TextPad).