Exemplo n.º 1
0
function feedimport_filestorage_dirlist($pid = 0, $prefix = '+', $userID = null, $counter = 0)
{
    if (!$counter) {
        $GLOBALS['filestorage_dirlist'] = array(0 => $GLOBALS['BL']['be_ftptakeover_rootdir']);
    }
    $pid = intval($pid);
    $sql = "SELECT f_id, f_name, f_uid, usr_login FROM " . DB_PREPEND . "phpwcms_file f ";
    $sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_user u ON u.usr_id=f.f_uid ";
    $sql .= "WHERE f.f_pid=" . $pid . " AND ";
    if (empty($_SESSION["wcs_user_admin"]) && $userID) {
        $sql .= "f.f_uid=" . intval($userID) . " AND ";
    }
    $sql .= "f.f_kid=0 AND f.f_trash=0 ORDER BY f_name";
    $result = _dbQuery($sql);
    if (isset($result[0])) {
        foreach ($result as $row) {
            if ($_SESSION["wcs_user_id"] != $row['f_uid']) {
                $row["f_name"] .= ' (' . $row["usr_login"] . ')';
            }
            $GLOBALS['filestorage_dirlist'][(int) $row['f_id']] = str_repeat($prefix, $counter + 1) . ' ' . $row["f_name"];
            feedimport_filestorage_dirlist($row['f_id'], $prefix, $userID, $counter + 1);
        }
    }
    if (!$counter) {
        $result = $GLOBALS['filestorage_dirlist'];
        unset($GLOBALS['filestorage_dirlist']);
        return $result;
    }
}
Exemplo n.º 2
0
<?php

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// set fields SBW gas rates
$plugin['fields'] = array('cnt_name' => 'STRING', 'cnt_text' => 'STRING', 'cnt_object-structure_level_id' => 'SELECT', 'cnt_object-article_template_detail' => 'SELECT', 'cnt_object-article_template_list' => 'SELECT', 'cnt_object-image_folder_id' => 'SELECT', 'cnt_object-image_url_replace' => 'STRING', 'cnt_object-feed_cache' => 'CHECK', 'cnt_object-feed_cache_timeout' => 'SELECT', 'cnt_object-activate_after_import' => 'CHECK', 'cnt_object-author_id' => 'SELECT', 'cnt_object-author_name' => 'STRING', 'cnt_object-source_link_add' => 'CHECK', 'cnt_object-source_link_text' => 'STRING', 'cnt_object-import_status_email' => 'STRING', 'cnt_status' => 'CHECK', 'cnt_prio' => 'HIDDEN');
$plugin['id'] = isset($_GET['edit']) ? intval($_GET['edit']) : 0;
$plugin['fields_cnt_object-structure_level_id'] = array('-2' => $BLM['cnt_object-structure_empty'], '-1' => ' ', 0 => $BL['be_admin_struct_index']) + struct_select_menu(0, 0, 0, 'array');
$plugin['fields_cnt_object-article_template_detail'] = feedimport_article_templates(PHPWCMS_TEMPLATE . 'inc_cntpart/articlesummary/article');
$plugin['fields_cnt_object-article_template_list'] = feedimport_article_templates(PHPWCMS_TEMPLATE . 'inc_cntpart/articlesummary/list');
$plugin['fields_cnt_object-author_id'] = feedimport_article_authors();
$plugin['fields_cnt_object-image_folder_id'] = feedimport_filestorage_dirlist();
$plugin['fields_cnt_object-feed_cache_timeout'] = array(60 => '1 ' . $BL['be_date_minute'], 300 => '5 ' . $BL['be_date_minutes'], 900 => '15 ' . $BL['be_date_minutes'], 1800 => '30 ' . $BL['be_date_minutes'], 3600 => '1 ' . $BL['be_date_hour'], 14400 => '4 ' . $BL['be_date_hours'] . ' (' . $BL['be_admin_tmpl_default'] . ')', 43200 => '12 ' . $BL['be_date_hours'], 86400 => '1 ' . $BL['be_date_day'], 172800 => '2 ' . $BL['be_date_days'], 604800 => '1 ' . $BL['be_date_week'], 1209600 => '2 ' . $BL['be_date_weeks'], 2592000 => '1 ' . $BL['be_date_month']);
// process post form
if (isset($_POST['cnt_name'])) {
    $plugin['data'] = array('id' => intval($_POST['id']), 'ref' => MODULE_KEY);
    foreach ($plugin['fields'] as $key => $value) {
        switch ($value) {
            case 'RADIO':
            case 'HIDDEN':
            case 'TEXTAREA':
            case 'SELECT':
            case 'STRING':
                $plugin['data'][$key] = isset($_POST[$key]) ? clean_slweg($_POST[$key]) : '';
                break;
            case 'CHECK':
                $plugin['data'][$key] = empty($_POST[$key]) ? 0 : 1;