Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <lphuberdeau@us...> - 2008-08-03 18:40:28
|
Revision: 14033 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=14033&view=rev Author: lphuberdeau Date: 2008-08-03 18:40:38 +0000 (Sun, 03 Aug 2008) Log Message: ----------- [FIX] Reduce the amount of accepted characters to improve matching in complex situations Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2008-08-03 15:58:03 UTC (rev 14032) +++ trunk/lib/profilelib/profilelib.php 2008-08-03 18:40:38 UTC (rev 14033) @@ -169,9 +169,9 @@ if( is_array( $value ) ) foreach( $value as $v ) $array = array_merge( $array, $this->traverseForReferences( $v ) ); - elseif( preg_match( '/^\$((([^:]+):)?(([^:]+):))?(.+)$/', $value, $parts ) ) + elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $value, $parts ) ) $array[] = $this->convertReference( $parts ); - elseif( preg_match_all( '/\$profileobject:((([^:]+):)?(([^:]+):))?([^\$]+)\$/', $value, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $value, $parts, PREG_SET_ORDER ) ) foreach( $parts as $row ) $array[] = $this->convertReference( $row ); @@ -215,7 +215,7 @@ if( is_array( $data ) ) foreach( $data as &$sub ) $this->replaceReferences( $sub ); - elseif( preg_match( '/^\$((([^:]+):)?(([^:]+):))?(.+)$/', $data, $parts ) ) + elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $data, $parts ) ) { $object = $this->convertReference( $parts ); $serialized = Tiki_Profile_Object::serializeNamedObject( $object ); @@ -225,7 +225,7 @@ $data = self::$known[$serialized]; } - elseif( preg_match_all( '/\$profileobject:((([^:]+):)?(([^:]+):))?([^\$]+)\$/', $data, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $data, $parts, PREG_SET_ORDER ) ) foreach( $parts as $row ) { $object = $this->convertReference( $row ); @@ -449,14 +449,14 @@ if( is_array( $value ) ) foreach( $value as $v ) $array = array_merge( $array, $this->traverseForReferences( $v ) ); - elseif( preg_match( '/^\$((([^:]+):)?(([^:]+):))?(.+)$/', $value, $parts ) ) + elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $value, $parts ) ) { $ref = $this->profile->convertReference( $parts ); if( $this->profile->domain == $ref['domain'] && $this->profile->profile == $ref['profile'] ) $array[] = $ref['object']; } - elseif( preg_match_all( '/\$profileobject:((([^:]+):)?(([^:]+):))?([^\$]+)\$/', $value, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $value, $parts, PREG_SET_ORDER ) ) { foreach( $parts as $row ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2008-08-04 14:14:30
|
Revision: 14040 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=14040&view=rev Author: lphuberdeau Date: 2008-08-04 14:14:35 +0000 (Mon, 04 Aug 2008) Log Message: ----------- [MOD] Support multiple profile blocks in a single page to improve readability [FIX] Pattern matching to support remote profiles Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2008-08-04 10:04:39 UTC (rev 14039) +++ trunk/lib/profilelib/profilelib.php 2008-08-04 14:14:35 UTC (rev 14040) @@ -7,6 +7,9 @@ class Tiki_Profile { + const SHORT_PATTERN = '/^\$((([\w\.-]+):)?((\w+):))?(\w+)$/'; + const LONG_PATTERN = '/\$profileobject:((([\w\.-]+):)?((\w+):))?(\w+)\$/'; + private $url; private $pageUrl; private $domain; @@ -120,19 +123,53 @@ $content = substr( $content, $begin + 2 ); $this->pageContent = $content; - $base = strpos( $content, '{CODE(caption=>YAML' ); - $begin = strpos( $content, ')}', $base ) + 2; - $end = strpos( $content, '{CODE}', $base ); + $pos = 0; - if( false === $base || false === $begin || false === $end ) - return false; + $this->data = array(); - $yaml = substr( $content, $begin, $end - $begin ); + while( false !== $base = strpos( $content, '{CODE(caption=>YAML', $pos ) ) + { + $begin = strpos( $content, ')}', $base ) + 2; + $end = strpos( $content, '{CODE}', $base ); + $pos = $end; - $this->data = Horde_Yaml::load( $yaml ); + if( false === $base || false === $begin || false === $end ) + return false; + + $yaml = substr( $content, $begin, $end - $begin ); + + $data = Horde_Yaml::load( $yaml ); + + foreach( $data as $key => $value ) + { + if( array_key_exists( $key, $this->data ) ) + $this->data[$key] = $this->mergeData( $this->data[$key], $value ); + else + $this->data[$key] = $value; + } + } + $this->getObjects(); } // }}} + function mergeData( $old, $new ) // {{{ + { + if( is_array( $old ) && is_array( $new ) ) + { + foreach( $new as $key => $value ) + { + if( is_numeric( $key ) ) + $old[] = $value; + else + $old[$key] = $value; + } + + return $old; + } + else + return $new; + } // }}} + function getNamedObjects() // {{{ { if( ! isset( $this->data['objects'] ) ) @@ -169,9 +206,9 @@ if( is_array( $value ) ) foreach( $value as $v ) $array = array_merge( $array, $this->traverseForReferences( $v ) ); - elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $value, $parts ) ) + elseif( preg_match( self::SHORT_PATTERN, $value, $parts ) ) $array[] = $this->convertReference( $parts ); - elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $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 ); @@ -215,7 +252,7 @@ if( is_array( $data ) ) foreach( $data as &$sub ) $this->replaceReferences( $sub ); - elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $data, $parts ) ) + elseif( preg_match( self::SHORT_PATTERN, $data, $parts ) ) { $object = $this->convertReference( $parts ); $serialized = Tiki_Profile_Object::serializeNamedObject( $object ); @@ -225,7 +262,7 @@ $data = self::$known[$serialized]; } - elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $data, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( self::LONG_PATTERN, $data, $parts, PREG_SET_ORDER ) ) foreach( $parts as $row ) { $object = $this->convertReference( $row ); @@ -449,14 +486,14 @@ if( is_array( $value ) ) foreach( $value as $v ) $array = array_merge( $array, $this->traverseForReferences( $v ) ); - elseif( preg_match( '/^\$(((\w+):)?((\w+):))?(\w+)$/', $value, $parts ) ) + elseif( preg_match( Tiki_Profile::SHORT_PATTERN, $value, $parts ) ) { $ref = $this->profile->convertReference( $parts ); if( $this->profile->domain == $ref['domain'] && $this->profile->profile == $ref['profile'] ) $array[] = $ref['object']; } - elseif( preg_match_all( '/\$profileobject:(((\w+):)?((\w+):))?(\w+)\$/', $value, $parts, PREG_SET_ORDER ) ) + elseif( preg_match_all( Tiki_Profile::LONG_PATTERN, $value, $parts, PREG_SET_ORDER ) ) { foreach( $parts as $row ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2008-08-06 13:08:26
|
Revision: 14094 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=14094&view=rev Author: lphuberdeau Date: 2008-08-06 13:08:31 +0000 (Wed, 06 Aug 2008) Log Message: ----------- [FIX] Make property merging recursive when merging multiple blocks Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2008-08-06 12:42:56 UTC (rev 14093) +++ trunk/lib/profilelib/profilelib.php 2008-08-06 13:08:31 UTC (rev 14094) @@ -161,7 +161,7 @@ if( is_numeric( $key ) ) $old[] = $value; else - $old[$key] = $value; + $old[$key] = $this->mergeData( $old[$key], $value ); } return $old; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2008-10-20 16:46:58
|
Revision: 15239 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15239&view=rev Author: lphuberdeau Date: 2008-10-20 16:46:55 +0000 (Mon, 20 Oct 2008) Log Message: ----------- [NEW] Support for date format conversion to unix timestamp in profiles Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2008-10-20 16:46:11 UTC (rev 15238) +++ trunk/lib/profilelib/profilelib.php 2008-10-20 16:46:55 UTC (rev 15239) @@ -333,6 +333,25 @@ if( count( $needles ) ) $data = str_replace( $needles, $replacements, $data ); + + $needles = array(); + $replacements = array(); + + // Replace date formats D(...) to unix timestamps + if( preg_match_all( "/D\\(([^\\)]+)\\)/", $data, $parts, PREG_SET_ORDER ) ) + foreach( $parts as $row ) + { + list( $full, $date ) = $row; + + if( false !== $conv = strtotime( $date ) ) + { + $needles[] = $full; + $replacements = $conv; + } + } + + if( count( $needles ) ) + $data = str_replace( $needles, $replacements, $data ); } } // }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2009-01-19 18:27:15
|
Revision: 16317 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=16317&view=rev Author: lphuberdeau Date: 2009-01-19 18:27:06 +0000 (Mon, 19 Jan 2009) Log Message: ----------- [MOD]?\194?\160Allow to load profiles from local DB Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2009-01-19 18:07:00 UTC (rev 16316) +++ trunk/lib/profilelib/profilelib.php 2009-01-19 18:27:06 UTC (rev 16317) @@ -137,13 +137,35 @@ public static function fromNames( $domain, $profile ) // {{{ { - if( strpos( $domain, 'http' ) !== 0 ) + if( strpos( $domain, '://' ) === false ) $domain = "http://$domain";; - $url = "$domain/tiki-export_wiki_pages.php?page=" . urlencode( $profile ); - return self::fromUrl( $url ); + if( $domain == 'tiki://local'; ) { + return self::fromDb( $profile ); + } else { + $url = "$domain/tiki-export_wiki_pages.php?page=" . urlencode( $profile ); + return self::fromUrl( $url ); + } } // }}} + + public static function fromDb( $pageName ) // {{{ + { + global $tikilib, $wikilib; + require_once 'lib/wiki/wikilib.php'; + $profile = new self; + $profile->domain = 'tiki://local';; + $profile->profile = $pageName; + $profile->pageUrl = $wikilib->sefurl($pageName); + $profile->url = 'tiki://local/'; . urlencode($pageName); + + $info = $tikilib->get_page_info( $pageName ); + $content = html_entity_decode( $info['data'] ); + $profile->loadYaml( $content ); + + return $profile; + } // }}} + private function __construct() // {{{ { } // }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2009-01-19 22:22:50
|
Revision: 16323 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=16323&view=rev Author: lphuberdeau Date: 2009-01-19 21:38:42 +0000 (Mon, 19 Jan 2009) Log Message: ----------- [MOD] Allow user input to specify filters Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2009-01-19 21:21:47 UTC (rev 16322) +++ trunk/lib/profilelib/profilelib.php 2009-01-19 21:38:42 UTC (rev 16323) @@ -9,7 +9,7 @@ { const SHORT_PATTERN = '/^\$((([\w\.-]+):)?((\w+):))?(\w+)$/'; const LONG_PATTERN = '/\$profileobject:((([\w\.-]+):)?((\w+):))?(\w+)\$/'; - const INFO_REQUEST = '/\$profilerequest:([^\$]+)\$([^\$]+)\$/'; + const INFO_REQUEST = '/\$profilerequest:([^\$\|]+)(\|(\w+))?\$([^\$]+)\$/'; private $url; private $pageUrl; @@ -394,13 +394,21 @@ if( preg_match_all( self::INFO_REQUEST, $data, $parts, PREG_SET_ORDER ) ) foreach( $parts as $row ) { - list( $full, $label, $default ) = $row; + list( $full, $label, $junk, $filter, $default ) = $row; if( ! array_key_exists( $label, $suppliedUserData ) ) $value = $default; else $value = $suppliedUserData[$label]; + if( $filter ) + $value = TikiFilter::get($filter)->filter($value); + else + $value = TikiFilter::get('xss')->filter($value); + + if( empty($value) ) + $value = $default; + $needles[] = $full; $replacements[] = $value; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sept_7@us...> - 2009-01-23 13:55:18
|
Revision: 16381 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=16381&view=rev Author: sept_7 Date: 2009-01-23 13:55:15 +0000 (Fri, 23 Jan 2009) Log Message: ----------- [ENH] use correct paths for the included files... Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2009-01-23 13:52:34 UTC (rev 16380) +++ trunk/lib/profilelib/profilelib.php 2009-01-23 13:55:15 UTC (rev 16381) @@ -1,8 +1,8 @@ <?php -require_once( 'Horde/Yaml.php' ); -require_once( 'Horde/Yaml/Loader.php' ); -require_once( 'Horde/Yaml/Node.php' ); -require_once( 'Horde/Yaml/Exception.php' ); +require_once( 'lib/Horde/Yaml.php' ); +require_once( 'lib/Horde/Yaml/Loader.php' ); +require_once( 'lib/Horde/Yaml/Node.php' ); +require_once( 'lib/Horde/Yaml/Exception.php' ); class Tiki_Profile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2009-05-27 20:03:10
|
Revision: 19136 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=19136&view=rev Author: lphuberdeau Date: 2009-05-27 20:02:59 +0000 (Wed, 27 May 2009) Log Message: ----------- [MOD] Apply content fetching on the entire profile to allow wikicontent: in preferences Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2009-05-27 20:00:40 UTC (rev 19135) +++ trunk/lib/profilelib/profilelib.php 2009-05-27 20:02:59 UTC (rev 19136) @@ -233,9 +233,42 @@ } } + $this->fetchExternals(); $this->getObjects(); } // }}} + private function fetchExternals() // {{{ + { + $this->traverseForExternals( $this->data ); + } // }}} + + private function traverseForExternals( &$data ) // {{{ + { + if( is_array( $data ) ) + foreach( $data as &$value ) + $this->traverseForExternals( $value ); + elseif( 0 === strpos( $data, 'wikicontent:' ) ) + { + $pageName = substr( $data, strlen('wikicontent:') ); + $data = $this->getPageContent( $pageName ); + } + } // }}} + + private function getPageContent( $pageName ) // {{{ + { + $exportUrl = dirname( $this->url ) . '/tiki-export_wiki_pages.php?' + . http_build_query( array( 'page' => $pageName ) ); + + $content = tiki_get_remote_file( $exportUrl ); + $content = str_replace( "\r", '', $content ); + $begin = strpos( $content, "\n\n" ); + + if( $begin !== false ) + return substr( $content, $begin + 2 ); + else + return null; + } // }}} + function mergeData( $old, $new ) // {{{ { if( is_array( $old ) && is_array( $new ) ) @@ -616,8 +649,6 @@ { $this->data = &$data; $this->profile = $profile; - - $this->fetchExternals(); } // }}} function isWellStructured() // {{{ @@ -711,38 +742,6 @@ return $this->profile; } // }}} - private function fetchExternals() // {{{ - { - $this->traverseForExternals( $this->data ); - } // }}} - - private function traverseForExternals( &$data ) // {{{ - { - if( is_array( $data ) ) - foreach( $data as &$value ) - $this->traverseForExternals( $value ); - elseif( 0 === strpos( $data, 'wikicontent:' ) ) - { - $pageName = substr( $data, strlen('wikicontent:') ); - $data = $this->getPageContent( $pageName ); - } - } // }}} - - public function getPageContent( $pageName ) // {{{ - { - $exportUrl = dirname( $this->profile->url ) . '/tiki-export_wiki_pages.php?' - . http_build_query( array( 'page' => $pageName ) ); - - $content = tiki_get_remote_file( $exportUrl ); - $content = str_replace( "\r", '', $content ); - $begin = strpos( $content, "\n\n" ); - - if( $begin !== false ) - return substr( $content, $begin + 2 ); - else - return null; - } // }}} - function __get( $name ) // {{{ { if( array_key_exists( $name, $this->data['data'] ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sylvieg@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. |
From: <jonnybradley@us...> - 2010-03-25 19:12:55
|
Revision: 26320 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=26320&view=rev Author: jonnybradley Date: 2010-03-25 19:12:49 +0000 (Thu, 25 Mar 2010) Log Message: ----------- [FIX] Enable profiles to recognise YAML in plugins edited by the plugin editor Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2010-03-25 19:09:32 UTC (rev 26319) +++ trunk/lib/profilelib/profilelib.php 2010-03-25 19:12:49 UTC (rev 26320) @@ -250,11 +250,11 @@ $this->data = array(); - while( false !== $base = strpos( $content, '{CODE(caption=>YAML', $pos ) ) + while( false !== $base = $this->findNextPluginStart($content, $pos) ) { $begin = strpos( $content, ')}', $base ) + 2; $end = strpos( $content, '{CODE}', $base ); - $pos = $end; + $pos = $end + 6; if( false === $base || false === $begin || false === $end ) return false; @@ -275,6 +275,16 @@ $this->fetchExternals(); $this->getObjects(); } // }}} + + private function findNextPluginStart($content, $pos) { + preg_match('/\{CODE\(\s*caption\s*=[>]?\s*[\'"]?YAML/', substr($content, $pos), $matches); + if (count($matches) > 0) { + $pattern = $matches[0]; + } else { + $pattern = '{CODE(caption=>YAML'; + } + return strpos( $content, $pattern, $pos ); + } private function fetchExternals() // {{{ { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jonnybradley@us...> - 2010-03-27 19:30:50
|
Revision: 26345 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=26345&view=rev Author: jonnybradley Date: 2010-03-27 19:30:44 +0000 (Sat, 27 Mar 2010) Log Message: ----------- [ENH] Add wikiparsed: external type so you can use the parsed output of wiki pages in profiles Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2010-03-27 19:23:55 UTC (rev 26344) +++ trunk/lib/profilelib/profilelib.php 2010-03-27 19:30:44 UTC (rev 26345) @@ -293,13 +293,16 @@ private function traverseForExternals( &$data ) // {{{ { - if( is_array( $data ) ) - foreach( $data as &$value ) + if( is_array( $data ) ) { + foreach( $data as &$value ) { $this->traverseForExternals( $value ); - elseif( 0 === strpos( $data, 'wikicontent:' ) ) - { + } + } else if ( 0 === strpos( $data, 'wikicontent:' ) ) { $pageName = substr( $data, strlen('wikicontent:') ); $data = $this->getPageContent( $pageName ); + } else if ( 0 === strpos( $data, 'wikiparsed:' ) ) { + $pageName = substr( $data, strlen('wikiparsed:') ); + $data = $this->getPageParsed( $pageName ); } } // }}} @@ -327,6 +330,27 @@ return null; } // }}} + public function getPageParsed( $pageName ) // {{{ + { + if ($this->domain == 'tiki://local'; || strpos($this->domain, 'localhost') === 0) { + global $tikilib; + $info = $tikilib->get_page_info($pageName); + if (empty($info)) { + $this->setFeedback(tra('Page cannot be found').' '.$pageName); + return null; + } + return $tikilib->parse_data($info['data']); + } + $pageUrl = dirname( $this->url ) . '/tiki-index_raw.php?' + . http_build_query( array( 'page' => $pageName ) ); + + $content = TikiLib::httprequest( $pageUrl ); + // index_raw replaces index.php with itself, so undo that here + $content = str_replace( 'tiki-index_raw.php', 'tiki-index.php', $content ); + + return $content; + } // }}} + function mergeData( $old, $new ) // {{{ { if( is_array( $old ) && is_array( $new ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sylvieg@us...> - 2010-06-02 12:59:58
|
Revision: 27472 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=27472&view=rev Author: sylvieg Date: 2010-06-02 12:59:51 +0000 (Wed, 02 Jun 2010) Log Message: ----------- [ENH]datachannel: to be able to use {{user}} and other in the yaml Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2010-06-02 09:03:02 UTC (rev 27471) +++ trunk/lib/profilelib/profilelib.php 2010-06-02 12:59:51 UTC (rev 27472) @@ -186,6 +186,7 @@ $info = $tikilib->get_page_info( $pageName ); $content = html_entity_decode( $info['data'] ); + $tikilib->parse_wiki_argvariable($content); $profile->loadYaml( $content ); return $profile; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2011-07-05 13:34:55
|
Revision: 35209 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=35209&view=rev Author: lphuberdeau Date: 2011-07-05 13:34:49 +0000 (Tue, 05 Jul 2011) Log Message: ----------- [FIX] Cannot be called as a static method anymore Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2011-07-04 21:13:24 UTC (rev 35208) +++ trunk/lib/profilelib/profilelib.php 2011-07-05 13:34:49 UTC (rev 35209) @@ -149,7 +149,7 @@ if( $profile->analyseMeta( $url ) ) { // Obtain the page export - $content = TikiLib::httprequest( $url ); + $content = TikiLib::lib('tiki')->httprequest( $url ); $content = html_entity_decode( $content ); $content = str_replace( "\r", '', $content ); @@ -337,7 +337,7 @@ $exportUrl = dirname( $this->url ) . '/tiki-export_wiki_pages.php?' . http_build_query( array( 'page' => $pageName ) ); - $content = TikiLib::httprequest( $exportUrl ); + $content = TikiLib::lib('tiki')->httprequest( $exportUrl ); $content = str_replace( "\r", '', $content ); $begin = strpos( $content, "\n\n" ); @@ -361,7 +361,7 @@ $pageUrl = dirname( $this->url ) . '/tiki-index_raw.php?' . http_build_query( array( 'page' => $pageName ) ); - $content = TikiLib::httprequest( $pageUrl ); + $content = TikiLib::lib('tiki')->httprequest( $pageUrl ); // index_raw replaces index.php with itself, so undo that here $content = str_replace( 'tiki-index_raw.php', 'tiki-index.php', $content ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lphuberdeau@us...> - 2011-08-09 19:25:47
|
Revision: 35964 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=35964&view=rev Author: lphuberdeau Date: 2011-08-09 19:10:29 +0000 (Tue, 09 Aug 2011) Log Message: ----------- [ENH] Profile parser a bit more flexible about what it accepts Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2011-08-09 19:02:27 UTC (rev 35963) +++ trunk/lib/profilelib/profilelib.php 2011-08-09 19:10:29 UTC (rev 35964) @@ -261,25 +261,26 @@ $this->data = array(); - while( false !== $base = $this->findNextPluginStart($content, $pos) ) + $matches = WikiParser_PluginMatcher::match($content); + $parser = new WikiParser_PluginArgumentParser; + + foreach ($matches as $match) { - $begin = strpos( $content, ')}', $base ) + 2; - $end = strpos( $content, '{CODE}', $base ); - $pos = $end + 6; + $arguments = $parser->parse($match->getArguments()); + if ( ($match->getName() == 'code' && isset($arguments['caption']) && $arguments['caption'] == 'YAML') + || $match->getName() == 'profile' ) + { + $yaml = $match->getBody(); - if( false === $base || false === $begin || false === $end ) - return false; + $data = Horde_Yaml::load( $yaml ); - $yaml = substr( $content, $begin, $end - $begin ); - - $data = Horde_Yaml::load( $yaml ); - - foreach( $data as $key => $value ) - { - if( array_key_exists( $key, $this->data ) ) - $this->data[$key] = $this->mergeData( $this->data[$key], $value ); - else - $this->data[$key] = $value; + foreach( $data as $key => $value ) + { + if( array_key_exists( $key, $this->data ) ) + $this->data[$key] = $this->mergeData( $this->data[$key], $value ); + else + $this->data[$key] = $value; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chealer@us...> - 2011-12-29 19:47:32
|
Revision: 39346 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39346&view=rev Author: chealer Date: 2011-12-29 19:47:25 +0000 (Thu, 29 Dec 2011) Log Message: ----------- Profiles: Fix HTML-encoded page content when applying a profile from a Tiki 8 or below profile server. Note: For Tiki 9 and above profile servers, this actually causes a regression (content will be incorrectly HTML-decoded). This can be removed in the future. Ref: r39206 Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39206&view=rev Modified Paths: -------------- trunk/lib/profilelib/profilelib.php Modified: trunk/lib/profilelib/profilelib.php =================================================================== --- trunk/lib/profilelib/profilelib.php 2011-12-29 08:45:23 UTC (rev 39345) +++ trunk/lib/profilelib/profilelib.php 2011-12-29 19:47:25 UTC (rev 39346) @@ -336,10 +336,16 @@ $content = str_replace("\r", '', $content); $begin = strpos($content, "\n\n"); - if ( $begin !== false ) - return substr($content, $begin + 2); - else + if ( $begin !== false ) { + $content = substr($content, $begin + 2); + + // This allows compatibility with Tiki 8 and below, which export page content HTML-escaped. This should not be done for Tiki 9 and above and should be removed once only these are supported (after Tiki 6 reaches EOL). + $content = htmlspecialchars_decode($content); + + return $content; + } else { return null; + } } // }}} public function getPageParsed( $pageName ) // {{{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Marc Laporte <marc@ma...> - 2011-12-29 23:06:05
Attachments:
Message as HTML
|
Hi! Could the system detect Tiki8 vs Tiki9? because I doubt we'll be able to sync the releases perfectly. Maybe where we set profile server, it should say the Tiki version (or something?) Thanks! M :-) On 2011-12-29 2:47 PM, <chealer@...> wrote: > Revision: 39346 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39346&view=rev > Author: chealer > Date: 2011-12-29 19:47:25 +0000 (Thu, 29 Dec 2011) > Log Message: > ----------- > Profiles: Fix HTML-encoded page content when applying a profile from a > Tiki 8 or below profile server. > Note: For Tiki 9 and above profile servers, this actually causes a > regression (content will be incorrectly HTML-decoded). This can be removed > in the future. > Ref: r39206 > > Revision Links: > -------------- > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39206&view=rev > > Modified Paths: > -------------- > trunk/lib/profilelib/profilelib.php > > Modified: trunk/lib/profilelib/profilelib.php > =================================================================== > --- trunk/lib/profilelib/profilelib.php 2011-12-29 08:45:23 UTC (rev 39345) > +++ trunk/lib/profilelib/profilelib.php 2011-12-29 19:47:25 UTC (rev 39346) > @@ -336,10 +336,16 @@ > $content = str_replace("\r", '', $content); > $begin = strpos($content, "\n\n"); > > - if ( $begin !== false ) > - return substr($content, $begin + 2); > - else > + if ( $begin !== false ) { > + $content = substr($content, $begin + 2); > + > + // This allows compatibility with Tiki 8 and > below, which export page content HTML-escaped. This should not be done for > Tiki 9 and above and should be removed once only these are supported (after > Tiki 6 reaches EOL). > + $content = htmlspecialchars_decode($content); > + > + return $content; > + } else { > return null; > + } > } // }}} > > public function getPageParsed( $pageName ) // {{{ > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Tikiwiki-cvs mailing list > Tikiwiki-cvs@... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > |
From: Filipus Klutiero <chealer@gm...> - 2011-12-30 06:58:37
|
Hi Marc, Le 2011-12-29 18:05, Marc Laporte a écrit : > Hi! > > Could the system detect Tiki8 vs Tiki9? because I doubt we'll be able to > sync the releases perfectly. Since there is no profile-specific protocol, it's not easy to change the protocol to version the format. It's probably possible to detect a pre-9 Tiki version in some ways, but I don't know them and this may not be robust. > Maybe where we set profile server, it should say the Tiki version (or > something?) You make me realize that the protocol spoke by profile servers will change with Tiki 9, and pre-Tiki 9 installs acting as profile clients won't know about that. The encoding given by the server won't be the one expected by clients, and I'm not sure what effects this will have. A workaround would be to make Tiki 9 encode its content to simulate the previous situation. If this has to be done, the question about Tiki 9 as a profile client becomes moot, things will work fine with r39346. Otherwise, I think your suggestion could work. To clarify, prior to Tiki 9 the profiles protocol effectively spoken by clients and servers has an issue. This issue disappears with Tiki 9, effectively changing the protocol spoken by both clients and servers, opening 2 possible incompatibilities: Tiki 9 or above client with a pre-Tiki 9 server Pre-Tiki 9 client with a Tiki 9 or above server The former case is not perfect, but shouldn't cause much issues with r39346. The last case could be a problem. > Thanks! > > M :-) > On 2011-12-29 2:47 PM,<chealer@...> wrote: > >> Revision: 39346 >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39346&view=rev >> Author: chealer >> Date: 2011-12-29 19:47:25 +0000 (Thu, 29 Dec 2011) >> Log Message: >> ----------- >> Profiles: Fix HTML-encoded page content when applying a profile from a >> Tiki 8 or below profile server. >> Note: For Tiki 9 and above profile servers, this actually causes a >> regression (content will be incorrectly HTML-decoded). This can be removed >> in the future. >> Ref: r39206 >> >> Revision Links: >> -------------- >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39206&view=rev >> >> Modified Paths: >> -------------- >> trunk/lib/profilelib/profilelib.php >> >> Modified: trunk/lib/profilelib/profilelib.php >> =================================================================== >> --- trunk/lib/profilelib/profilelib.php 2011-12-29 08:45:23 UTC (rev 39345) >> +++ trunk/lib/profilelib/profilelib.php 2011-12-29 19:47:25 UTC (rev 39346) >> @@ -336,10 +336,16 @@ >> $content = str_replace("\r", '', $content); >> $begin = strpos($content, "\n\n"); >> >> - if ( $begin !== false ) >> - return substr($content, $begin + 2); >> - else >> + if ( $begin !== false ) { >> + $content = substr($content, $begin + 2); >> + >> + // This allows compatibility with Tiki 8 and >> below, which export page content HTML-escaped. This should not be done for >> Tiki 9 and above and should be removed once only these are supported (after >> Tiki 6 reaches EOL). >> + $content = htmlspecialchars_decode($content); >> + >> + return $content; >> + } else { >> return null; >> + } >> } // }}} >> >> public function getPageParsed( $pageName ) // {{{ >> |
From: Filipus Klutiero <chealer@gm...> - 2012-01-18 01:55:42
|
On 2011-12-30 01:58, Filipus Klutiero wrote: > Hi Marc, > > Le 2011-12-29 18:05, Marc Laporte a écrit : >> Hi! >> >> Could the system detect Tiki8 vs Tiki9? because I doubt we'll be able to >> sync the releases perfectly. > > Since there is no profile-specific protocol, it's not easy to change > the protocol to version the format. It's probably possible to detect a > pre-9 Tiki version in some ways, but I don't know them and this may > not be robust. >> Maybe where we set profile server, it should say the Tiki version (or >> something?) > > You make me realize that the protocol spoke by profile servers will > change with Tiki 9, and pre-Tiki 9 installs acting as profile clients > won't know about that. The encoding given by the server won't be the > one expected by clients, and I'm not sure what effects this will have. I tested this quickly and saw no problems (using Slideshow_demo and looking at the Tiki Wiki CMS Groupware page again). > A workaround would be to make Tiki 9 encode its content to simulate > the previous situation. > If this has to be done, the question about Tiki 9 as a profile client > becomes moot, things will work fine with r39346. Otherwise, I think > your suggestion could work. > > To clarify, prior to Tiki 9 the profiles protocol effectively spoken > by clients and servers has an issue. This issue disappears with Tiki > 9, effectively changing the protocol spoken by both clients and > servers, opening 2 possible incompatibilities: > Tiki 9 or above client with a pre-Tiki 9 server > Pre-Tiki 9 client with a Tiki 9 or above server > > The former case is not perfect, but shouldn't cause much issues with > r39346. The last case could be a problem. >> Thanks! >> >> M :-) >> On 2011-12-29 2:47 PM,<chealer@...> wrote: >> >>> Revision: 39346 >>> >>> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39346&view=rev >>> Author: chealer >>> Date: 2011-12-29 19:47:25 +0000 (Thu, 29 Dec 2011) >>> Log Message: >>> ----------- >>> Profiles: Fix HTML-encoded page content when applying a profile from a >>> Tiki 8 or below profile server. >>> Note: For Tiki 9 and above profile servers, this actually causes a >>> regression (content will be incorrectly HTML-decoded). This can be >>> removed >>> in the future. >>> Ref: r39206 >>> >>> Revision Links: >>> -------------- >>> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39206&view=rev >>> >>> Modified Paths: >>> -------------- >>> trunk/lib/profilelib/profilelib.php >>> >>> Modified: trunk/lib/profilelib/profilelib.php >>> =================================================================== >>> --- trunk/lib/profilelib/profilelib.php 2011-12-29 08:45:23 UTC (rev >>> 39345) >>> +++ trunk/lib/profilelib/profilelib.php 2011-12-29 19:47:25 UTC (rev >>> 39346) >>> @@ -336,10 +336,16 @@ >>> $content = str_replace("\r", '', $content); >>> $begin = strpos($content, "\n\n"); >>> >>> - if ( $begin !== false ) >>> - return substr($content, $begin + 2); >>> - else >>> + if ( $begin !== false ) { >>> + $content = substr($content, $begin + 2); >>> + >>> + // This allows compatibility with Tiki 8 and >>> below, which export page content HTML-escaped. This should not be >>> done for >>> Tiki 9 and above and should be removed once only these are supported >>> (after >>> Tiki 6 reaches EOL). >>> + $content = htmlspecialchars_decode($content); >>> + >>> + return $content; >>> + } else { >>> return null; >>> + } >>> } // }}} >>> >>> public function getPageParsed( $pageName ) // {{{ >>> > |