]> CRI, Mines Paris - PSL - Plinn.git/blobdiff - Products/Plinn/skins/generic/getReplyFormPosition.py
Déplacement pour eggification.
[Plinn.git] / Products / Plinn / skins / generic / getReplyFormPosition.py
diff --git a/Products/Plinn/skins/generic/getReplyFormPosition.py b/Products/Plinn/skins/generic/getReplyFormPosition.py
new file mode 100644 (file)
index 0000000..a53b1dc
--- /dev/null
@@ -0,0 +1,18 @@
+##parameters=rows, position
+if position is None :
+       return None
+else :
+       reply = context.talkback.getReply(position)
+       
+       def isChildOfReply(firstAprox, reply) :
+               thread = reply.parentsInThread() + reply.getReplies() # hum !
+               return firstAprox in thread
+       
+       for i in range(len(rows)) :
+               if rows[i].object == reply :
+                       break
+
+       while rows[i].state > 0 and isChildOfReply(reply, rows[i].object) :
+               i+=1
+
+       return rows[i].object.id
\ No newline at end of file