From: <lra...@us...> - 2003-05-28 14:52:08
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs1:/tmp/cvs-serv16483 Modified Files: tiki-admin_structures.php Log Message: Wiki Structures improved (export all pages in a structure, export structure tree and create structure from tree supported) Index: tiki-admin_structures.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-admin_structures.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tiki-admin_structures.php 6 Apr 2003 19:33:49 -0000 1.4 +++ tiki-admin_structures.php 28 May 2003 14:52:04 -0000 1.5 @@ -2,6 +2,7 @@ // Initialization require_once('tiki-setup.php'); include_once('lib/structures/structlib.php'); +include_once("lib/ziplib.php"); if($tiki_p_edit_structures != 'y') { $smarty->assign('msg',tra("You dont have permission to use this feature")); @@ -16,6 +17,16 @@ $structlib->s_remove_page($_REQUEST["rremovex"],false); } +if(isset($_REQUEST['export'])) { + $structlib->s_export_structure($_REQUEST['export']); +} + +if(isset($_REQUEST['export_tree'])) { + header("content-type: text/plain"); + $structlib->s_export_structure_tree($_REQUEST['export_tree']); + die; +} + $smarty->assign('askremove','n'); if(isset($_REQUEST['remove'])) { @@ -25,6 +36,29 @@ if(isset($_REQUEST["create"])) { $structlib->s_create_page('','',$_REQUEST["name"]); +} + +if(isset($_REQUEST["create_from_tree"])) { + $tree_lines = explode("\n",$_REQUEST["tree"]); + $parents = Array(''); + $previous = Array(''); + foreach($tree_lines as $line) { + // count the tabs + $tabs = 0; + while(substr($line,0,1)==" ") { + $tabs++; + $line=substr($line,1); + } + $parents[$tabs+1]=$line; + $parent = $parents[$tabs]; + if(isset($previous[$tabs])) { + $prev=$previous[$tabs]; + } else { + $prev = ''; + } + $structlib->s_create_page($parent,$prev,$line); + $previous[$tabs]=$line; + } } if(!isset($_REQUEST["sort_mode"])) { |