update.
[chise/est.git] / cwiki-common.el
index ed37b7c..fa6a4e8 100644 (file)
@@ -2,7 +2,7 @@
 (require 'char-db-util)
 
 (defvar chise-wiki-view-url "view.cgi")
-(defvar chise-wiki-edit-url "edit/edit.cgi")
+(defvar chise-wiki-edit-url "edit.cgi")
 
 (defvar chise-wiki-bitmap-glyphs-url
   "http://chise.zinbun.kyoto-u.ac.jp/glyphs")
     (www-format-value-as-S-exp value)))
 
 (defun www-format-value (object feature-name
-                               &optional value format without-tags)
+                               &optional value format
+                               without-tags without-edit)
   (unless value
     (setq value (www-char-feature object feature-name)))
   (www-format-apply-value object feature-name
-                         format nil value nil nil without-tags)
+                         format nil value nil nil
+                         without-tags without-edit)
   )
 
 
 (defun www-format-apply-value (object feature-name
                                      format props value
                                      &optional uri-char uri-feature
-                                     without-tags)
+                                     without-tags without-edit)
   (let (ret)
     (setq ret
          (cond
           ((eq format 'wiki-text)
            (if without-tags
                (www-xml-format-list value)
-             (www-format-eval-list value object feature-name nil uri-char))
+             (www-format-eval-list value object feature-name nil uri-char
+                                   without-tags without-edit))
            )
           ((eq format 'S-exp)
            (www-format-encode-string
            (www-format-value-default value without-tags)
             ))
          )
-    (if (or without-tags (eq (plist-get props :mode) 'peek))
+    (if (or without-tags
+           without-edit
+           (eq (plist-get props :mode) 'peek))
        ret
       (format "%s <a href=\"%s?char=%s&feature=%s&format=%s\"
 ><input type=\"submit\" value=\"edit\" /></a>"
 
 (defun www-format-eval-feature-value (char
                                      feature-name
-                                     &optional format lang uri-char value)
+                                     &optional format lang uri-char value
+                                     without-tags without-edit)
   (unless value
     (setq value (www-char-feature char feature-name)))
   (unless format
     (www-format-apply-value
      char feature-name
      format nil value
-     uri-char (www-uri-encode-feature-name feature-name))
+     uri-char (www-uri-encode-feature-name feature-name)
+     without-tags without-edit)
     )
    ((consp format)
     (cond ((null (cdr format))
           (www-format-apply-value
            char feature-name
            (car format) (nth 1 format) value
-           uri-char (www-uri-encode-feature-name feature-name))
+           uri-char (www-uri-encode-feature-name feature-name)
+           without-tags without-edit)
           )
          (t
-          (www-format-eval-list format char feature-name lang uri-char)
+          (www-format-eval-list format char feature-name lang uri-char
+                                without-tags without-edit)
           )))))
 
 (defun www-format-eval-unit (exp char feature-name
-                                &optional lang uri-char value)
+                                &optional lang uri-char value
+                                without-tags without-edit)
   (unless value
     (setq value (www-char-feature char feature-name)))
   (unless uri-char
       (if (eq (car exp) 'value)
          (www-format-eval-feature-value char feature-name
                                         (plist-get (nth 1 exp) :format)
-                                        lang uri-char value)
+                                        lang uri-char value
+                                        without-tags without-edit)
        (www-format-apply-value
         char feature-name
         (car exp) (nth 1 exp) value
-        uri-char (www-uri-encode-feature-name feature-name)))
+        uri-char (www-uri-encode-feature-name feature-name)
+        without-tags without-edit))
       )
      ((eq (car exp) 'name)
       (format "<a href=\"%s?feature=%s&char=%s\">%s</a>"
 >%s</a
 >"
              (www-format-eval-list (plist-get (nth 1 exp) :ref)
-                                   char feature-name lang uri-char)
+                                   char feature-name lang uri-char
+                                   'without-tags 'without-edit)
              (www-format-eval-list (nthcdr 2 exp)
-                                   char feature-name lang uri-char)))
+                                   char feature-name lang uri-char
+                                   without-tags without-edit)))
      (t
       (format "<%s
 >%s</%s
 >"
              (car exp)
              (www-format-eval-list (nthcdr 2 exp) char feature-name
-                                   lang uri-char)
+                                   lang uri-char
+                                   without-tags without-edit)
              (car exp)))))))
 
 (defun www-format-eval-list (format-list char feature-name
-                                        &optional lang uri-char)
+                                        &optional lang uri-char
+                                        without-tags without-edit)
   (if (consp format-list)
       (mapconcat
        (lambda (exp)
-        (www-format-eval-unit exp char feature-name lang uri-char))
+        (www-format-eval-unit exp char feature-name lang uri-char
+                              nil without-tags without-edit))
        format-list "")
-    (www-format-eval-unit format-list char feature-name lang uri-char)))
+    (www-format-eval-unit format-list char feature-name lang uri-char
+                         nil without-tags without-edit)))
 
 
 ;;; @ XML generator