1 # ===================================================================== 2 # metaWeblog.getCategories: MetaWeblog API method. 3 # 4 # Copyright (c) 2007,2009 Carlo Strozzi 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; version 2 dated June, 1991. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 # 19 # ===================================================================== 20 21 # ===================================================================== 22 # Local variables and functions 23 # ===================================================================== 24 25 cgi.group = () 26 cgi.group.literal = () 27 28 # ===================================================================== 29 # Main program 30 # ===================================================================== 31 32 csaGetArgs POST 33 34 . $CSA_ROOT/lib/group-stuff.rc 35 36 . $CSA_ROOT/lib/group-editor.rc 37 38 # Blogging APIs are usually available only to editors. 39 ~ ,$TNS_AUTH_GRP, *,editor,* || csaExit.needauth 40 41 # Set the appropriate static response body. 42 43 if (~ $CSA_PGM($#CSA_PGM) mt.*) { 44 tpl.include.tw.rpc = $tw_gstem/cat-mt+xml 45 } else tpl.include.tw.rpc = $tw_gstem/cat-mw+xml 46 47 #if (~ $tpl_name tw-*) { 48 # 49 # # Page names beginning with tw-* are reserved for TW use, and usually 50 # # refer to views that do not correspond to actual pages on disk, so 51 # # we need to toggle unapplicable sections in templates. 52 # 53 # tpl.if.tw.ispage = '(::DEL:)' 54 # tpl.fi.tw.ispage = '(:DEL::)' 55 # tpl.if.tw.editor = '(::DEL:)' 56 # tpl.fi.tw.editor = '(:DEL::)' 57 #} 58 59 # Make sure no-replace mode is used on the page body by prepending 60 # its name with '-', or any user-supplied CSA tags in the text will 61 # be happily parsed by _envtoxml() !! 62 63 tpl.include.tw.rpc = -$'tpl.include.tw.rpc' 64 65 csaExit.ok 66 67 # End of program.