Beispiel #1
0
function net2ftp_plugin_printBodyOnload()
{
    // --------------
    // This function includes PHP files which are required by the active plugins
    // The list of current active plugins is stored in $net2ftp_globals["activePlugins"]
    // --------------
    // -------------------------------------------------------------------------
    // Global variables and settings
    // -------------------------------------------------------------------------
    global $net2ftp_globals;
    $pluginProperties = getPluginProperties();
    // -------------------------------------------------------------------------
    // Initial checks and initialization
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["activePlugins"] == "") {
        return "";
    }
    // -------------------------------------------------------------------------
    // For all plugins...
    // -------------------------------------------------------------------------
    for ($pluginnr = 0; $pluginnr < sizeof($net2ftp_globals["activePlugins"]); $pluginnr++) {
        // Get the plugin related data
        $currentPlugin = $pluginProperties[$net2ftp_globals["activePlugins"][$pluginnr]];
        // Check if the plugin should be used
        if ($currentPlugin["use"] != "yes") {
            continue;
        }
        // -------------------------------------------------------------------------
        // Print <body onload=""> code
        // -------------------------------------------------------------------------
        echo $currentPlugin["printBodyOnload"];
    }
    // end for
}
Beispiel #2
0
function printTextareaSelect($onchange)
{
    // --------------
    // This function prints a select with the available textareas
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_globals;
    $pluginProperties = getPluginProperties();
    if (isset($_POST["textareaType"]) == true) {
        $textareaType = validateTextareaType($_POST["textareaType"]);
    } else {
        $textareaType = "";
    }
    $filename_extension = get_filename_extension($net2ftp_globals["entry"]);
    // Convert *htm* to html
    if (strpos($filename_extension, "htm") !== false) {
        $filename_extension = "html";
    }
    echo "<select name=\"textareaSelect\" id=\"textareaSelect\" onchange=\"{$onchange}\">\n";
    if ($textareaType == "" || $textareaType == "plain") {
        $plainselected = "selected=\"selected\"";
    }
    echo "<option value=\"plain\" {$plainselected}>Normal textarea</option>\n";
    while (list($pluginName, $value) = each($pluginProperties)) {
        // Print only the plugins which have 'use' set to yes
        //                        which are textareas
        //                        which are suitable for this browser
        //                        which are suitable for this type of file
        if ($pluginProperties[$pluginName]["use"] == "yes" && $pluginProperties[$pluginName]["type"] == "textarea" && in_array($net2ftp_globals["browser_agent"], $pluginProperties[$pluginName]["browsers"]) == true && in_array($filename_extension, $pluginProperties[$pluginName]["filename_extensions"]) == true) {
            if ($pluginName == $textareaType) {
                $selected = "selected=\"selected\"";
            } else {
                $selected = "";
            }
            echo "<option value=\"{$pluginName}\" {$selected}>" . $pluginProperties[$pluginName]["label"] . "</option>\n";
        }
        // end if
    }
    // end while
    echo "</select>\n";
}