Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
subversion [2010/02/20 14:03]
palehorse
subversion [2012/12/31 07:16] (current)
Line 1: Line 1:
 +~~NOCACHE~~
 +====== SubVersion ======
 <php> <php>
 $helpers = $this->​loadHelper('​helpers',​ true); $helpers = $this->​loadHelper('​helpers',​ true);
 if (!$helpers) die; if (!$helpers) die;
  
-foreach ​($_REQUEST ​as $name =$value{ +$url = "​http://​127.0.0.1/​websvn/";​ 
-echo $name . "<br />\n"; +if (strlen($_REQUEST["​websvnlistingrepname"​]) > 0) $url ."​listing.php?​repname="​ . $_REQUEST["​websvnlistingrepname"​];​ 
-}+if (strlen($_REQUEST["​websvnlogrepname"​]> 0) $url .= "​log.php?​rev="​ . $_REQUEST["​revision"​] . "&​repname="​ . $_REQUEST["​websvnlogrepname"​];​ 
 +if (strlen($_REQUEST["​websvnfiledetailsrepname"​]) > 0) $url ."filedetails.php?​repname="​ . $_REQUEST["​websvnfiledetailsrepname"​];​ 
 +if (strlen($_REQUEST["​websvnrevisionrepname"​]) ​0) $url .= "revision.php?​rev="​ . $_REQUEST["​revision"​] . "&​repname="​ . $_REQUEST["​websvnrevisionrepname"​]
 +if (strlen($_REQUEST["​path"​]) > 0) $url .= "&​path="​ . $_REQUEST["​path"​];​
  
 $http_helper = $helpers->​_create_helper_object($helpers->​HTTP_HELPER);​ $http_helper = $helpers->​_create_helper_object($helpers->​HTTP_HELPER);​
-$http_response = $http_helper->​get('​http://​127.0.0.1/​websvn/'​''​''​);+$http_response = $http_helper->​get($url""​""​);
  
 $xhtml_helper = $helpers->​_create_helper_object($helpers->​XHTML_HELPER);​ $xhtml_helper = $helpers->​_create_helper_object($helpers->​XHTML_HELPER);​
 $xhtml_helper->​from_string($http_response->​body);​ $xhtml_helper->​from_string($http_response->​body);​
-$body = $xhtml_helper->​get_element("​body"​)->​inner_xml;​+$body_element ​= $xhtml_helper->​get_element("​body"​)
 +$body = $body_element->​inner_xml;​ 
 + 
 +#This section is used to extract some of the elements and move them to different places in the document. 
 +foreach ($body_element->​get_elements("​p"​) as $xml_element) { 
 + if (preg_match("/<​span class=\"​changes\">/",​ $xml_element->​inner_xml)) { 
 + $action_buttons = $xml_element->​inner_xml;​ 
 + $body = str_replace($xml_element->​inner_xml,​ "",​ $body); 
 +
 +
 +foreach ($body_element->​get_elements("​form"​) as $xml_element) { 
 + if (preg_match("/​name=\"​selectproj\"/",​ $xml_element->​inner_xml)) { 
 + $project_form = $xml_element->​inner_xml;​ 
 + $body = str_replace($xml_element->​inner_xml,​ "",​ $body); 
 +
 + if (preg_match("/​Rev <input type=\"​hidden\"/",​ $xml_element->​inner_xml)) { 
 + $revision_form = $xml_element->​inner_xml;​ 
 + $body = str_replace($xml_element->​inner_xml,​ "",​ $body); 
 +
 +}
  
 echo "<​div id=\"​IncludedExternalPage\">​\n";​ echo "<​div id=\"​IncludedExternalPage\">​\n";​
  
-#echo "<​script src=\"​doku.php?​id=torrents&​do=get_jscript\"></​script>​\n";​ +echo "<​script src=\"​doku.php?​id=subversion&​do=get_jscript\"></​script>​\n";​ 
-#echo "<​link rel=\"​stylesheet\"​ href=\"​doku.php?​id=torrents&​do=get_stylesheet\"​ type=\"​text/​css\"></​link>​\n";​+echo "<​link rel=\"​stylesheet\"​ href=\"​doku.php?​id=subversion&​do=get_stylesheet\"​ type=\"​text/​css\"></​link>​\n";​
  
 #we just need to tidy up some image locations, etc #we just need to tidy up some image locations, etc
 $body = preg_replace("/​listing.php\?/",​ "​doku.php?​id=subversion&​websvnlisting",​ $body); $body = preg_replace("/​listing.php\?/",​ "​doku.php?​id=subversion&​websvnlisting",​ $body);
 +$body = preg_replace("/​rss.php\?/",​ "​doku.php?​id=subversion&​do=get_resource&​resource=rss.php&",​ $body);
 +$body = preg_replace("/​log.php\?/",​ "​doku.php?​id=subversion&​websvnlog",​ $body);
 +$body = preg_replace("/​filedetails.php\?/",​ "​doku.php?​id=subversion&​websvnfiledetails",​ $body);
 +$body = preg_replace("/​\.\/​templates\/​calm\/​images\//",​ "​doku.php?​do=get_image&​id=subversion&​image=images/",​ $body);
 $body = preg_replace("/&​amp;/",​ "&",​ $body); $body = preg_replace("/&​amp;/",​ "&",​ $body);
 +$body = preg_replace("/<​h1>​Subversion Repositories<​\/​h1>/",​ "",​ $body);
 +$body = preg_replace("/<​h1><​a href=\"​\.\?​\"​ title=\"​Subversion Repositories\">​Subversion Repositories<​\/​a>/",​ "<​h2>​Repositry:​ ", $body);
 +$body = preg_replace("/<​\/​a><​\/​span><​\/​h1>​\n\n<​h2 class=\"​path\"​ style=\"​margin:​0 2% 15px 2%;​\">/",​ "</​a>",​ $body);
 +$body = preg_replace("/​\[<​a href=/",​ "<a href=",​ $body);
 +$body = preg_replace("/<​\/​a>​]/",​ "</​a>",​ $body);
 +$body = preg_replace("/<​\/​a>​]/",​ "</​a>",​ $body);
 +$body = preg_replace("/​\[<​b>/",​ "<​b>",​ $body);
 +$body = preg_replace("/<​\/​b>​\/​\]/",​ "</​b>/",​ $body);
 +$body = preg_replace("/​rev=/",​ "​revision=",​ $body);
 echo $body; echo $body;
  
 echo "</​div>​\n";​ echo "</​div>​\n";​
 </​php>​ </​php>​