Example #1
0
function echo_widgetclass_form($params, $phase = '', $widget_group = '')
{
    global $ADMIN_PATH, $db, $nc_core;
    $params = (array) $params;
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    if (get_fs()) {
        $widget_editor = new nc_widget_editor($nc_core->WIDGET_TEMPLATE_FOLDER, $nc_core->db);
        $widget_editor->load($params['Widget_Class_ID'], null, $params['File_Hash']);
    }
    echo "<form method='post' id='nc_widgetclass_form' action='index.php'>";
    if (get_fs() && $phase != 3) {
        $widget_absolute_path = $widget_editor->get_absolute_path();
        $widget_filemanager_link = $nc_core->SUB_FOLDER . $nc_core->HTTP_ROOT_PATH . "modules/filemanager/admin.php?page=manager&phase=1&dir=" . $nc_core->SUB_FOLDER . $nc_core->HTTP_TEMPLATE_PATH . 'widget' . $widget_editor->get_relative_path();
        ?>
        <br />
        <div><?php 
        echo sprintf(CONTROL_WIDGETCLASS_FILES_PATH, $widget_filemanager_link, $widget_absolute_path);
        ?>
</div>
        <br />
	<?php 
    }
    echo "<input type='hidden' name='fs' value='" . get_fs() . "' /><fieldset>" . "" . WIDGET_ADD_NAME . ":<br />" . nc_admin_input_simple('Name', $params['Name'], 50) . "<br /><br />" . "" . WIDGET_ADD_KEYWORD . ":<br />" . nc_admin_input_simple('Keyword', $params['Keyword'], 50) . "<br /><br />";
    $widgetCategory = $db->get_col("SELECT DISTINCT `Category` FROM `Widget_Class`");
    echo CONTROL_USER_GROUP . ":<br /><select name='Category' style='width:auto;'>\n";
    foreach ($widgetCategory as $wc) {
        if ($params['Category'] == $wc || $widget_group == md5($wc)) {
            echo "\t<option value='" . $wc . "' selected='selected'>" . $wc . "</option>\n";
        } else {
            echo "\t<option value='" . $wc . "'>" . $wc . "</option>\n";
        }
    }
    echo "</select>&nbsp;&nbsp;&nbsp;" . "" . WIDGET_ADD_NEWGROUP . "&nbsp;&nbsp;&nbsp;" . nc_admin_input_simple('Category_New', null, 25, '', "maxlength='64'") . "</fieldset>" . "<table border='0' cellpadding='6' cellspacing='0' width='100%' ><tr style='display: none;'><td colspan='2'>" . "<div id='DescriptionOn' style='display: none'>" . "<p style='cursor: pointer;' onclick='document.getElementById(\"DescriptionOn\").style.display=\"none\";document.getElementById(\"DescriptionOff\").style.display=\"\";'> &#x25BC; " . WIDGET_ADD_DESCRIPTION . ":</p>" . "<br />" . nc_admin_textarea_simple('Description', $params['Description'], '', 8, 60, "id='Description'") . "</div></td></tr></table><br />" . "<legend>" . WIDGET_ADD_OBJECTVIEW . "</legend>" . "<table border='0' cellpadding='6' cellspacing='0' width='100%' >" . "<tr>" . "<td>" . nc_admin_textarea_resize('Template', $params['Template'], "" . WIDGET_ADD_PAGEBODY . ":", 10, 60, 'PageBody') . "</td>" . "</tr>" . "</table>" . "<br />" . "<legend>" . WIDGET_ADD_DOPL . "</legend>" . "<table border='0' cellpadding='0' cellspacing='0' width='100%' >" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('InDevelop', 1, WIDGET_ADD_DEVELOP, $params['InDevelop']) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('WidgetDisallow', 1, WIDGET_ADD_DISALLOW, $params['WidgetDisallow']) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "<font>" . nc_admin_checkbox_simple('IsStatic', 1, WIDGET_IS_STATIC, isset($params['IsStatic']) ? $params['IsStatic'] : 1) . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . "" . WIDGET_ADD_UPDATE . ":<br />" . nc_admin_input_simple('Update', $params['Update'], 5) . "\n        <br />" . "</td>" . "</tr>" . "<tr>" . "<td colspan='2'>" . nc_admin_textarea_resize('Settings', $params['Settings'], "<br>" . WIDGET_ADD_SYSTEM . ":", 8, 60) . "</td>" . "</tr>" . ($phase == 30 ? "<tr><td colspan='2'><a href='" . $nc_core->SUB_FOLDER . $nc_core->HTTP_ROOT_PATH . "action.php?ctrl=admin.backup&amp;action=export_run&amp;raw=1&amp;type=widget_class&amp;id=" . $params['Widget_Class_ID'] . "&amp;" . $nc_core->token->get_url() . "'>" . WIDGET_LIST_EXPORT . "</a></td></tr>" : "") . "</table>";
    echo_remind_script();
}
Example #2
0
/**
 * Returns an array with all file system files according to $conf['file_ext']
 *
 * @param string $path
 * @param bool $recursive
 * @return array
 */
function get_fs($path, $recursive = true)
{
    global $conf;
    // because isset is faster than in_array...
    if (!isset($conf['flip_picture_ext'])) {
        $conf['flip_picture_ext'] = array_flip($conf['picture_ext']);
    }
    if (!isset($conf['flip_file_ext'])) {
        $conf['flip_file_ext'] = array_flip($conf['file_ext']);
    }
    $fs['elements'] = array();
    $fs['thumbnails'] = array();
    $fs['representatives'] = array();
    $subdirs = array();
    if (is_dir($path)) {
        if ($contents = opendir($path)) {
            while (($node = readdir($contents)) !== false) {
                if ($node == '.' or $node == '..') {
                    continue;
                }
                if (is_file($path . '/' . $node)) {
                    $extension = get_extension($node);
                    if (isset($conf['flip_picture_ext'][$extension])) {
                        if (basename($path) == 'thumbnail') {
                            $fs['thumbnails'][] = $path . '/' . $node;
                        } elseif (basename($path) == 'pwg_representative') {
                            $fs['representatives'][] = $path . '/' . $node;
                        } else {
                            $fs['elements'][] = $path . '/' . $node;
                        }
                    } elseif (isset($conf['flip_file_ext'][$extension])) {
                        $fs['elements'][] = $path . '/' . $node;
                    }
                } elseif (is_dir($path . '/' . $node) and $node != 'pwg_high' and $recursive) {
                    $subdirs[] = $node;
                }
            }
        }
        closedir($contents);
        foreach ($subdirs as $subdir) {
            $tmp_fs = get_fs($path . '/' . $subdir);
            $fs['elements'] = array_merge($fs['elements'], $tmp_fs['elements']);
            $fs['thumbnails'] = array_merge($fs['thumbnails'], $tmp_fs['thumbnails']);
            $fs['representatives'] = array_merge($fs['representatives'], $tmp_fs['representatives']);
        }
    }
    return $fs;
}
Example #3
0
?>
		</select>
		<i class='nc-caret'></i>
	</div>
</div>
<hr>

<div style="padding-right:15px">
	<?php 
foreach ((array) $widgets as $row) {
    ?>
	<?php 
    $toolbar = $nc_core->ui->toolbar()->left();
    ?>
	<?php 
    $href = "admin.php?widget_id=" . $row->Widget_ID . "&fs=" . get_fs() . "&phase=";
    ?>
	<?php 
    $toolbar->add_btn($href . 20)->click('parent.nc_form(this.href);return false')->icon('copy')->title(NETCAT_MODERATION_COPY_OBJECT);
    ?>
	<?php 
    $toolbar->add_btn($href . 30)->icon('edit')->title(NETCAT_MODERATION_CHANGE);
    ?>
	<?php 
    $toolbar->add_btn($href . 61)->click('parent.nc_action_message(this.href);return false')->icon('remove')->title(NETCAT_MODERATION_DELETE);
    ?>
	<?php 
    $toolbar->add_divider();
    ?>
	<?php 
    $toolbar->add_btn('#', WIDGET_LIST_INSERT_CODE)->click('return showhide(this, "' . $row->Keyword . '")');
Example #4
0
exec:~cd|20|0|0|1|||||php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~md|20|0|0|1|||||php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~mkdir|20|0|0|1|||||php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~rmdir|20|0|0|1|||||php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
exec:~execfs|20|0|0|1|||||php scripts/execfs.php %%trailing%% %%nick%% %%dest%% %%alias%%
*/
#####################################################################################################
# TODO: WEB PAGE VIEWER FOR FILESYSTEM STRUCTURE
ini_set("display_errors", "on");
require_once "lib.php";
require_once "execfs_lib.php";
$trailing = trim($argv[1]);
$nick = strtolower(trim($argv[2]));
$dest = strtolower(trim($argv[3]));
$alias = strtolower(trim($argv[4]));
$fs = get_fs();
$privmsg = True;
switch ($alias) {
    case "~execfs":
        if ($trailing == "sync") {
            $data = get_bucket(BUCKET_FS);
            $fp = fsockopen("irciv.us.to", 80);
            if ($fp === False) {
                privmsg("  execfs sync error: unable to connect to remote host");
            } else {
                fwrite($fp, $request);
                $response = "";
                while (!feof($fp)) {
                    $response = $response . fgets($fp, 1024);
                }
                fclose($fp);