Documentation is available at classes_permission.php
- <?php
- class permission extends b_object {
- //NOTE - object type definition "user types"
- var $name;
- var $constraintArray;
- function permission( $constructID = NULL ) {
- $this->constraintArray = array();
- parent::b_object( $constructID, 'permissions' );
- if( $relationshipType =& $GLOBALS['core']->get_relationship_type( 'permission-constraint' ) && $relationships = $relationshipType->get_byValue( array( array( 'attribute'=>'primaryID', 'operator'=>'=', 'value'=>$this->id ), array( 'attribute'=>'secondaryID', 'operator'=>'=', 'value'=>$this->id ) ) ) ) {
- foreach( $relationships as $relationship ) {
- $related =& get_object( ($relationship->get_attribute('primaryID') == $this->id) ? $relationship->get_attribute('secondaryID') : $relationship->get_attribute('primaryID') );
- $this->constraintArray[$related->id] =& $related;
- }
- }
- }
- //NOTE: these functions are here to overload the base class functions if special data validation etc is needed
- //function &get_attribute( $attribute ) { }
- //function set_attribute( $attribute, $value ) { }
- //function set( $values ) { }
- //function set_db( $values ) { }
- //function set_object( $values ) { }
- //function delete() { }
- function get_contents( $navArray = NULL ) {
- //echos content for viewing / editing a single permission
- //NOTE: multi-dimensional constraint arrays need to be coded: permission = array( 'owner_constraint', 'array_constraints'=>array( <constraints> ) )
- if( $_GET['module'] ) { $module = 'module='.$_GET['module'].'&'; }
- $returnString;
- //open the form
- $returnString .='<form name="theForm" action="'.echo_url(true, false).'?'.$module.'object_type='.$this->type->get_attribute( 'type_name' ).'&object='.$this->id.'" method="post">';
- //output toolbar and navigation
- $returnString .= '<div id="sidebar">'.get_nav_content($navArray).'</div>';
- //open the content div
- $returnString .= '<div id="sub_content">';
- //output title info
- $returnString .= $this->get_title();
- //output an errors in submitted form data
- $returnString .= error_text();
- //close the form
- $returnString .= '</form>';
- //output any relationships
- if( $this->id != '*new*' ) {
- $returnString .= $this->get_relationships_content();
- }
- //close the content div
- $returnString .= '</div>';
- return $returnString;
- }
- function get_index() {
- return $this->name;
- }
- function verify_set( $post ) {
- //verifies data before setting the object's values - returns an error array if problems are found
- if( allowed( 'edit permissions' ) ) {
- $this->set( $post );
- }
- }
- }
- ?>
Documentation generated on Tue, 24 May 2005 03:57:13 -0400 by phpDocumentor 1.3.0RC3