plugins/SpecialPageFuncs.php
changeset 1301 bd9e124f5904
parent 1295 3c9c1b18567b
child 1352 d97cf005f674
equal deleted inserted replaced
1300:1f97ee3ec614 1301:bd9e124f5904
    32 	register_special_page('SpecialPages', 'specialpage_special_pages');
    32 	register_special_page('SpecialPages', 'specialpage_special_pages');
    33 	register_special_page('About_Enano', 'specialpage_about_enano');
    33 	register_special_page('About_Enano', 'specialpage_about_enano');
    34 	register_special_page('GNU_General_Public_License', 'specialpage_gnu_gpl');
    34 	register_special_page('GNU_General_Public_License', 'specialpage_gnu_gpl');
    35 	register_special_page('TagCloud', 'specialpage_tag_cloud');
    35 	register_special_page('TagCloud', 'specialpage_tag_cloud');
    36 	register_special_page('Autofill', 'specialpage_autofill', false);
    36 	register_special_page('Autofill', 'specialpage_autofill', false);
       
    37 	register_special_page('AjaxUpload', 'specialpage_ajaxupload', false);
    37 }
    38 }
    38 
    39 
    39 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    40 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    40 
    41 
    41 function page_Special_CreatePage()
    42 function page_Special_CreatePage()
   701 	}
   702 	}
   702 	
   703 	
   703 	echo enano_json_encode($dataset);
   704 	echo enano_json_encode($dataset);
   704 }
   705 }
   705 
   706 
       
   707 function page_Special_AjaxUpload()
       
   708 {
       
   709 	if ( isset($_GET['uploadstatus']) )
       
   710 	{
       
   711 		session_start();
       
   712 		header('Content-type: text/javascript');
       
   713 		$key = "upload_progress_{$_GET['uploadstatus']}";
       
   714 		$info = isset($_SESSION[$key]) ? $_SESSION[$key] : array();
       
   715 		if ( isset($_SESSION[$key]) && $_SESSION[$key]['done'] )
       
   716 			unset($_SESSION[$key]);
       
   717 		
       
   718 		if ( is_array($info) )
       
   719 		{
       
   720 			$info['current_time'] = time();
       
   721 			if ( !empty($_GET['cancel']) )
       
   722 				$_SESSION[$key]['cancel_upload'] = $info['cancel_upload'] = true;
       
   723 		}
       
   724 		$info['form'] = $_GET['form'];
       
   725 		
       
   726 		echo enano_json_encode($info);
       
   727 		exit;
       
   728 	}
       
   729 }
       
   730 
   706 ?>
   731 ?>