openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

CMS.class.php (1549B)


      1 <?php 
      2 
      3 define('CMS_READ'  ,'GET' );
      4 define('CMS_WRITE' ,'POST');
      5 
      6 class CMS extends Client
      7 {
      8 	var $login = false;
      9 	var $token;
     10 
     11 	function login($user, $password,$dbid )
     12 	{
     13 		
     14 		// Erster Request der Sitzung muss ein GET-Request sein.
     15 		// Hier wird auch der Token gelesen.
     16 		$result = $this->call(CMS_READ,'login','login' );
     17 		
     18 		$result = $this->call(CMS_WRITE,'login','login',array('login_name'=>$user,'login_password'=>$password,'dbid'=>$dbid) );
     19 		
     20 		if	( $result['success'] != 'true' ) {
     21 			throw new Exception( 'Login failed. '.print_r($result['notices'],true));
     22 		}
     23 	}
     24 	
     25 	
     26 	function projectlist()
     27 	{
     28 		$result = $this->call(CMS_READ,'projectlist','edit' );
     29 
     30 // 		Logger::debug( print_r($result,true) );
     31 		return( $result['output'] );
     32 	}
     33 
     34 	
     35 	function project($projectid)
     36 	{
     37 		$result = $this->call(CMS_READ,'project','edit',array('id'=>$projectid) );
     38 	
     39 		return( $result['output'] );
     40 	}
     41 	
     42 	function folder($id)
     43 	{
     44 		$result = $this->call(CMS_READ,'folder','edit',array('id'=>$id) );
     45 	
     46 		return( $result['output'] );
     47 	}
     48 	
     49 	function page($id)
     50 	{
     51 		$result = $this->call(CMS_READ,'page','edit',array('id'=>$id) );
     52 	
     53 		return( $result['output'] );
     54 	}
     55 	
     56 	function link($id)
     57 	{
     58 		$result = $this->call(CMS_READ,'link','edit',array('id'=>$id) );
     59 	
     60 		return( $result['output'] );
     61 	}
     62 	
     63 	function file($id)
     64 	{
     65 		$result = $this->call(CMS_READ,'file','edit',array('id'=>$id) );
     66 	
     67 		return( $result['output'] );
     68 	}
     69 
     70 	function filevalue($id)
     71 	{
     72 		$result = $this->call(CMS_READ,'file','show',array('id'=>$id) );
     73 	
     74 		return( $result['output'] );
     75 	}
     76 	
     77 }
     78 
     79 ?>