Пример #1
0
	public function load( $id = null )
	{
		global $_CB_framework;

		$plugin		=	cbconsultationsClass::getPlugin();
		$myId		=	$_CB_framework->myId();

		parent::load( (int) $id );

		if ( ! $this->get( 'id' ) ) {
			if ( ! $this->get( 'user' ) ) {
				$this->set( 'user', (int) $myId );
			}

			if ( $this->get( 'category' ) == '' ) {
				$this->set( 'category', $plugin->params->get( 'consultation_int_category_default', 'General' ) );
			}

			if ( ! $this->get( 'published' ) ) {
				$this->set( 'published', (int) $plugin->params->get( 'consultation_approval', 0 ) );
			}

			if ( ! $this->get( 'access' ) ) {
				$this->set( 'access', (int) $plugin->params->get( 'consultation_access_default', 1 ) );
			}
		}

		return true;
	}