15)); SDV($GUIEditSnippetsPage, 'Site.GUIEditSnippets'); function GUIEditSnippetsInit($pagename) { global $GUIButtons, $GUIEditSnippetsPage; foreach($GUIButtons as $k=>$a) { for($i=1; $i<4; $i++) $GUIButtons[$k][$i] = GUIEditOneSnippet($pagename, $a[$i], false); $GUIButtons[$k][4] = trim(GUIEditOneSnippet($pagename, $a[4], true)); } } function GUIEditOneSnippet($pagename, $txt, $icon=false) { if(! preg_match('/^\\$:\\w(?:[\\w-]*\\w)?$/', $txt, $m)) return $txt; global $VersionNum, $GUIEditSnippetsPage; $pn = FmtPageName($GUIEditSnippetsPage, $pagename); $val = PageVar($pn, $m[0]); if(is_null($val)) $val = ''; $rArr = array( '/"/' => '\\"', "/'/" => "\\'", "/\n/" => '\\n', ); $iArr = array( "/'/" => "'", "/ '<', "/>/" => '>', "/\n/" => ' ', ); if($VersionNum < 2003015) { if(! $icon) $val = PHSC(PPRA($rArr, $val), ENT_QUOTES); else $val = PPRA($iArr, $val); } return $val; }