Api.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00048 class Api
00049 {
00050 var $output = '';
00051 var $objectid = 0;
00052 var $page;
00053
00054 function db()
00055 {
00056 return db_connection();
00057 }
00058
00059 function pageid()
00060 {
00061 echo 'WARNING: pageid() deprecated!<br>';
00062 global $SESS;
00063 return $SESS['objectid'];
00064 }
00065
00066 function getObjectId()
00067 {
00068 return $this->objectid;
00069 }
00070
00071 function setObjectId( $objectid )
00072 {
00073 $this->objectid = $objectid;
00074 }
00075
00076 function getRootObjectId()
00077 {
00078 return Folder::getRootObjectId();
00079 }
00080
00081 function folderid()
00082 {
00083 global $SESS;
00084 return $SESS['folderid'];
00085 }
00086
00087
00088 function execute( $code )
00089 {
00090 global $conf_tmpdir;
00091 $code = "<?php\n".$code."\n?>";
00092
00093 $tmp = $conf_tmpdir.'/'.md5(microtime()).'.tmp';
00094 $f = fopen( $tmp,'w' );
00095 fwrite( $f,$code );
00096 fclose( $f );
00097
00098 require( $tmp );
00099
00100 unlink( $tmp );
00101 $inhalt = Api::getOutput();
00102 $this->output( $inhalt );
00103 }
00104
00105 function delOutput()
00106 {
00107 $this->output = '';
00108 }
00109
00110 function output( $text )
00111 {
00112 $this->output .= $text;
00113 }
00114
00115
00116 function getOutput()
00117 {
00118 return $this->output;
00119 }
00120 }