From: <sy...@us...> - 2010-02-13 21:03:44
|
Revision: 25186 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=25186&view=rev Author: sylvieg Date: 2010-02-13 21:03:38 +0000 (Sat, 13 Feb 2010) Log Message: ----------- [FIX]profile: do not use httprequest but directly get the page when the datachannel is local (domain=tiki://local) Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2010-02-13 21:00:56 UTC (rev 25185) +++ trunk/lib/profilelib/profilelib.php 2010-02-13 21:03:38 UTC (rev 25186) @@ -43,7 +43,6 @@ } } // }}} - public static function convertLists( $data, $conversion, $prependKey = false ) // {{{ { foreach( $conversion as $key => $endValue ) @@ -290,6 +289,15 @@ public function getPageContent( $pageName ) // {{{ { + if ($this->domain == 'tiki://local') { + global $tikilib; + $info = $tikilib->get_page_info($pageName); + if (empty($info)) { + $this->setFeedback(tra('Page cannot be found').' '.$pageName); + return null; + } + return $info['data']; + } $exportUrl = dirname( $this->url ) . '/tiki-export_wiki_pages.php?' . http_build_query( array( 'page' => $pageName ) ); @@ -359,9 +367,10 @@ $array = array_merge( $array, $this->traverseForReferences( $v ) ); elseif( preg_match( self::SHORT_PATTERN, $value, $parts ) ) $array[] = $this->convertReference( $parts ); - elseif( preg_match_all( self::LONG_PATTERN, $value, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( self::LONG_PATTERN, $value, $parts, PREG_SET_ORDER ) ) { foreach( $parts as $row ) $array[] = $this->convertReference( $row ); + } return $array; } // }}} @@ -632,8 +641,10 @@ while( ! empty( $objects ) ) { // Circular dependency found... give what we have - if( $counter++ > count($objects) * 2 ) + if( $counter++ > count($objects) * 2 ) { + $this->setFeedback(tra('Circular reference')); break; + } $object = array_shift( $objects ); $refs = $object->getInternalReferences(); @@ -716,7 +727,11 @@ function isWellStructured() // {{{ { - return isset( $this->data['type'], $this->data['data'] ); + $is = isset( $this->data['type'], $this->data['data'] ); + if (!$is) { + $this->setFeedback(tra('Syntax error: ').tra("Needs a 'type' and 'data' field")); + } + return $is; } // }}} function getType() // {{{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |