コード例 #1
0
ファイル: htmlshifter.php プロジェクト: mndrwd/freedomeditor
 function htmlshifter($klikit, $str = false)
 {
     global $browsers, $__lang, $tmplext;
     $string = gethatmpl($klikit, "index");
     if (!isset($_GET['cat']) || $_GET['cat'] == '') {
         $_GET['cat'] = 1;
     }
     if (!isset($_GET['ele'])) {
         if (!isset($_GET['fn'])) {
             $_GET['fn'] = '';
         }
         $_GET['ele'] = $_GET['fn'];
     }
     $arr[0] = '{langtag}';
     $arr[1] = dir_ls($GLOBALS['__the_cwd'] . "/" . $GLOBALS['_cfg']['folders']['language']);
     $arr[1] = $arr[1]['fd'];
     $langarr = getlanghtml($arr);
     $strraw[0] = ele_content($klikit);
     if (!isset($mmv)) {
         $mmv = '';
     }
     if (!isset($mmh)) {
         $mmh = '';
     }
     $strraw[1] = str_replace(array("{ext:ajaxurlvar:ension}"), array($GLOBALS['_cfg']['global']['ajax_urlvar']), guilang(str_replace(array("{ext:currentwd:ension}", "{ext:wwwroot:ension}", "{ext:def_request_folder:ension}", "{ext:mimemodesftlog:ension}", "{ext:colorshizzle:ension}", "{ext:language:ension}", "{ext:browsers:ension}", "{ext:memohori:ension}", "{ext:memoverti:ension}", "{ext:cat:ension}", "{ext:rawele_name:ension}", "{ext:ele_name:ension}", "{ext:cat_loop:ension}", "{ext:ele_loop:ension}", "{ext:cat_loop_sel:ension}", "{ext:inputtags:ension}", "{ext:inputtagsext:ension}"), array($GLOBALS['currentwd'], $GLOBALS['WIMPY_BASE']['path']['www'], urlencode(htmlentities($GLOBALS['_cfg']['global']['default_request_folder'])), editormimemode($GLOBALS['_cfg']['ext_links']), gethatmpl(0, "colors"), $langarr, getbrowsershtml($browsers), $mmh, $mmv, $_GET['cat'], htmlentities($_GET['ele']), urlencode(htmlentities($_GET['ele'])), getcathtml($klikit), getclixele($klikit, htmlentities($_GET['cat'])), getcathtml($klikit, "cat_sel"), gethatmpl(0, "inputtags"), gethatmpl(0, "inputtags" . $GLOBALS['current_extlink'])), $string), $__lang));
     # $strraw[1]=make_object(guilang(make_object(), $__lang), $guicfg, $hex);
     return $strraw;
 }
コード例 #2
0
ファイル: init.php プロジェクト: mndrwd/freedomeditor
 function linkfldrarr($klikit, $extlink, $fd = '', $retcwd = false)
 {
     global $__lang;
     $klikit = array();
     $klikit[$__lang['folders']] = array();
     #echo html_entity_decode($_GET['fd']);die();
     #echo getcwd()." ".str_replace("//", "/", html_entity_decode($_GET['fd']))."<hr />";
     #if (isset($_GET['fd']) &&strlen($_GET['fd'])>0 && is_Dir(str_replace("//", "/", html_entity_decode($_GET['fd'])))){
     #	echo $_GET['fd'];die();
     if ($fd == '') {
         $fd = str_replace("//", "/", str_replace("%2F", "/", html_entity_decode(html_entity_decode($_GET['fd']))));
     }
     #}
     if ($retcwd == true) {
         chdir($fd);
         return getcwd();
     }
     if (isset($_GET['newfoldername'])) {
         $newname = filesystemcode($_GET['newfoldername'], 'b', 'c');
         $chdir = getcwd();
         chdir($fd);
         mkdir($newname, 755);
         chdir($chdir);
         unset($chdir);
     } elseif (isset($_GET['newfilename'])) {
         $newname = filesystemcode($_GET['newfilename'], 'b', 'c');
         $chdir = getcwd();
         chdir($fd);
         file_put_contents($newname, "");
         chdir($chdir);
         unset($chdir);
     } elseif (isset($_GET['newname'])) {
         $chdir = getcwd();
         chdir($fd);
         rename(rawurldecode($_GET['fn']), filesystemcode(rawurldecode($_GET['newname']), 'b', 'c'));
         chdir($chdir);
     } elseif (isset($_GET['cutcopy'])) {
         $chdir = getcwd();
         chdir($fd);
         if ($_GET['cutcopy'] == 'cut') {
             rename(str_replace("+", " ", $_GET['pastefromlocation']), filesystemcode(str_replace("+", " ", $_GET['ccitemname']), 'b', 'c'));
         } elseif ($_GET['cutcopy'] == 'copy') {
             rcopy(str_replace("+", " ", $_GET['pastefromlocation']), filesystemcode(str_replace("+", " ", $_GET['ccitemname']), 'b', 'c'));
         }
         chdir($chdir);
     }
     #if ($fd=='' || $fd==$GLOBALS['_cfg']['global']['default_request_folder']){
     #}else{}
     #if ($fd=='.'){$fd=$GLOBALS['_cfg']['global']['default_request_folder'];}
     #Prepare folder display selection with current userinput
     #echo "<pre>";print_r($__lang);die();
     $filecont = '/*cat=' . $__lang['files'] . '_*/';
     #    $_GET['cat']=$__lang['files'];
     if (!isset($fd) || $fd == '') {
         $fd = $GLOBALS['_cfg']['global']['default_request_folder'];
     }
     if (!isset($fd) || $fd == '') {
         $fd = '.';
     }
     #load defaults ;/
     #	echo $fd;die();
     #	echo $extlink;die();
     $dircont = dir_ls($fd . "/", $extlink);
     #echo "<pre>";print_r($dircont);
     if (is_array($dircont)) {
         foreach ($extlink as $d => $test) {
             #echo "<pre>";print_r($dircont);die();
             if (isset($dircont['fn'][$d]) && is_array($dircont['fn'][$d])) {
                 foreach ($dircont['fn'][$d] as $b) {
                     if (!isset($klikit[$__lang['files']][$b])) {
                         if (isset($_GET) && isset($_GET['ele']) && $b == html_entity_decode($_GET['ele'])) {
                             $klikit[$__lang['files']][$b] = file_get_contents(str_replace("//", "/", html_entity_decode($fd)) . "/" . $b);
                             $klikit[$__lang['files']][$b] = mb_convert_encoding($klikit[$__lang['files']][$b], 'UTF-8', mb_detect_encoding($klikit[$__lang['files']][$b], 'UTF-8, ISO-8859-1', true));
                             #echo
                             #strlen(
                             #$klikit[$__lang['files']][$b]
                             #)
                             #."<br />";
                         } else {
                             #	if ($d=="no_ext" && $GLOBALS['_cfg']['global']['universal_unlinked_ext_files']!="none" || $d!="no_ext"){
                             if (!isset($klikit[$__lang['files']][$b])) {
                                 $klikit[$__lang['files']][$b] = '';
                             }
                             #	}
                         }
                     }
                 }
             }
         }
         if (isset($dircont['fd']) && is_array($dircont['fd'])) {
             $klikit[$__lang['folders']] = array_flip($dircont['fd']);
         }
     } elseif (isset($_GET['cat']) && $dircont == "nf") {
         $klikit[html_entity_decode($_GET['cat'])]['LANGempty_folderIANG'] = "";
         $_GET['ele'] = '';
     } elseif (isset($_GET['cat']) && $dircont == "na") {
         $klikit[html_entity_decode($_GET['cat'])]['LANGaccess_deniedIANG'] = "";
         $_GET['ele'] = '';
     }
     $klikity['fd'] = $fd;
     $klikity['klikit'] = $klikit;
     #   print_r($klikity);die();
     #die();
     return $klikity;
 }