Documentation is available at module_display_functions.php
- <?php
- function system_beta_1_process_post() {
- //handle any data passed via POST or GET methods
- session_start();
- if( isset($_SESSION['new_object']['object']) && $_SESSION['new_object']['object'] == $_GET['object'] ) {
- //if the user is returning to an object they've just related a new object to
- //update session values
- if( isset( $_SESSION['new_object']['previousReferrers'] ) ) {
- $previous = unserialize( $_SESSION['new_object']['previousReferrers'] );
- unset( $_SESSION['new_object'] );
- $_SESSION['new_object']['referrer'] = array_pop( $previous );
- strtok( $_SESSION['new_object']['referrer'], "&" );
- while( $variable = strtok( "&" ) ) {
- if( strpos( $variable, "object=" ) ) {
- $_SESSION['new_object']['object'] = substr( strpos( $variable, '=')+1 );
- break;
- }
- }
- if( !count($previous) ) {
- unset( $_SESSION['new_object']['previousReferrers'] );
- }
- } else {
- unset( $_SESSION['new_object'] );
- }
- } else if((isset($_POST['related']) && strstr( $_POST['related'], "*new*" ) ) ) {
- //if a new object should be created for relating to an existing object redirect to the appropriate page for creating that object
- strtok( $_POST['related'], "?" );
- $constraints = unserialize( strtok( "?" ) );
- relate_new_object( $constraints );
- } else if( isset($_POST['embed_type']) ) {
- //if an embed is beind added
- //relate_new_object();
- }
- if( $_POST || $_REQUEST['action'] ) {
- //if data has been posted from a form
- if( $_REQUEST['action'] == 'logout' ) {
- //if the user is logging out
- people_log_out();
- } else if( $_REQUEST['action'] == "delete" ) {
- //if the object should be deleted
- if( $object =& get_object( $_GET['object'] ) ) {
- $object->delete();
- }
- } else if( $_REQUEST['action'] == 'delete_relationship' ) {
- //if a relationship should be deleted
- if( $object =& get_relationship( $_POST['relationship'], $_POST['relationship_type'] ) ) {
- $object->delete();
- }
- } else {
- if( $_POST['action'] == 'new_relationship' ) {
- //if the data is for making a new relationship
- if( $_POST['target'] == 'secondary' ) {
- $primary = $_POST['object'];
- $secondary = $_POST['related'];
- } else {
- $secondary = $_POST['object'];
- $primary = $_POST['related'];
- }
- $relationship =& new relationship( NULL, $_POST['relationship_type'], $primary, $secondary );
- } else if( $object =& get_object( $_GET['object'], $_GET['object_type'] ) ) {
- //if an object is being modified
- $object->verify_set( $_POST );
- //NOTE: this is where we're having problems i think
- if( $_SESSION['new_object'] && !count($GLOBALS['errorArray']) ) {
- //if the object being edited is to be related to another object and the object was set OK
- //determine the primary and secondary objects
- if( $_SESSION['new_object']['target'] == 'secondary' ) {
- $primary = $_SESSION['new_object']['object'];
- $secondary = $object->id;
- } else {
- $secondary = $_SESSION['new_object']['object'];
- $primary = $object->id;
- }
- //create the new relationship
- $relationship =& new relationship( NULL, $_SESSION['new_object']['typeID'], $primary, $secondary );
- }
- }
- //if a new object is being set with data, redirect to the object's page
- if( $_GET['object'] == '*new*' && $object->id != '*new*' ) {
- $redirectString = "Location: ".echo_url(true);
- $redirectString = str_replace( '*new*', $object->id, $redirectString );
- header( $redirectString );
- }
- }
- }
- }
- function system_beta_1_get_module_tab_html() {
- //system implementatioin of get_module_tabs
- return '<a href="system_management.php?module=system" onmouseout="this.style.color=\'#999999\'"onmouseover="this.style.color=\'#000000\'">system</a>';
- }
- ?>
Documentation generated on Tue, 24 May 2005 03:58:41 -0400 by phpDocumentor 1.3.0RC3