Index: branches/RC/core/units/fck/fck_eh.php =================================================================== diff -u -r10974 -r11265 --- branches/RC/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 10974) +++ branches/RC/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 11265) @@ -19,7 +19,7 @@ $this->permMapping = array_merge($this->permMapping, $permissions); } - + function CreateXmlHeader() { ob_end_clean() ; @@ -37,7 +37,7 @@ header( 'Content-Type: text/xml; charset=utf-8' ) ; // Create the XML document header. } - + function OnLoadCmsTree(&$event) { $event->status = erSTOP; @@ -51,7 +51,7 @@ $pages = $st_options['options']; $page_ids = array_keys($pages); $tpls = $this->Application->Conn->GetCol('SELECT NamedParentPath, CategoryId FROM '.TABLE_PREFIX.'Category WHERE CategoryId IN ('.join(',', $page_ids).')', 'CategoryId'); - + //$res = ''; foreach ($pages as $id => $title) { $page_path = preg_replace('/^content\//', '', strtolower($tpls[$id]).'.html'); @@ -61,13 +61,13 @@ } } else { - + $lang = $this->Application->GetVar('m_lang'); - + $query = 'SELECT PageId, Path, l'.$lang.'_Title AS Title FROM '.TABLE_PREFIX.'Pages ORDER By l'.$lang.'_Title'; $pages = $this->Application->Conn->Query($query); - - $res = ''; + +// $res = ''; foreach ($pages as $page) { $page_path = $page['Path'].'.html'; $title = $page['Title'].' ('.$page_path.')'; @@ -78,38 +78,38 @@ echo $res; } - + function OnRenameFile(&$event) { $event->status = erSTOP; $old_name = $this->Application->GetVar('old_name'); $new_name = $this->Application->GetVar('new_name'); $folder = $this->Application->GetVar('folder'); $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; - + if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) { echo 204; return; - } - + } + $fck_helper =& $this->Application->recallObject('FCKHelper'); /* @var fck_helper fckFCKHelper*/ if (!$fck_helper->IsAllowedExtension($folder, $new_name)) { echo 203; return; } - + if (!rename($sServerDir.$old_name,$sServerDir.$new_name)) { // echo $sServerDir.$old_name.' -> '.$sServerDir.$new_name; echo 205; return; - } - + } + echo '0'; } - - + + function OnDeleteFiles(&$event) { $event->status = erSTOP; @@ -118,41 +118,41 @@ $a_files = explode('|', $files); $folder = $this->Application->GetVar('folder'); $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; - + foreach ($a_files AS $file) { @unlink($sServerDir.$file); } - + // print_r($a_files); } - + function OnGetFoldersFilesList(&$event) { $this->CreateXmlHeader(); $fck_helper =& $this->Application->recallObject('FCKHelper'); /* @var fck_helper fckFCKHelper*/ $ret = ''."\n" ; - $ret .= ""."\n"; + $ret .= ""."\n"; $ret .= $fck_helper->PrintFolders(); - $ret .= $fck_helper->PrintFiles(); - $ret .= ""."\n"; + $ret .= $fck_helper->PrintFiles(); + $ret .= ""."\n"; echo $ret; exit; } - - + + function OnCreateFolder(&$event) { $event->status = erSTOP; - + $new_folder = $this->Application->GetVar('new_folder'); $current_folder = $this->Application->GetVar('current_folder'); $folderPath = WRITEABLE.'/user_files'.'/'.$current_folder."/".$new_folder; if ( file_exists( $folderPath ) && is_dir($folderPath)) { echo "101"; } - + if ( !file_exists( $folderPath ) ) { // Turn off all error reporting. @@ -169,16 +169,16 @@ ini_restore( 'error_reporting' ) ; if ($sErrorMsg) echo $sErrorMsg ; - else + else echo '0'; } } - + function OnUploadFile(&$event) { $event->status = erSTOP; $fck_helper =& $this->Application->recallObject('FCKHelper'); /* @var fck_helper fckFCKHelper*/ $fck_helper->UploadFile(); } -} +}