source: trunk/plugins/InsertSnippet/snippets.php @ 1165

Last change on this file since 1165 was 677, checked in by ray, 13 years ago

set svn:keywords property for the new files & all plugins

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 508 bytes
Line 
1<?php
2$snippets_file = 'snippets.html';
3
4include_once('../../contrib/php-xinha.php');
5
6if($passed_data = xinha_read_passed_data())
7{
8        extract($passed_data);     
9}
10$snippets = file_get_contents($snippets_file);
11preg_match_all('/<!--(.*?)-->(.*?)<!--\/.*?-->/s',$snippets,$matches);
12       
13$array=array();
14for ($i=0;$i<count($matches[1]);$i++)
15{
16        $id = $matches[1][$i];
17        $html = $matches[2][$i];
18        $array[] = array('id'=>$id,'HTML'=>$html);
19}
20print "var snippets = " . xinha_to_js($array);
21
22?>
Note: See TracBrowser for help on using the repository browser.