[dev] [patch] orator duration

Stefan Kronawithleitner stefan at kronawithleitner.at
Sun Feb 8 02:54:21 PST 2004


In current versions of Orator there are the attributes duration & effect, both 
not used, but duration is very useful. These two small patches implement the
duration - I'm not sure, that is is the best way to do this, but it works. When
the duration is set, the refresh-header is set, except for the last page of the
presentation. (perhaps loop the presentation, when duration at the last slide is
set?)

--- html.phpr        2004-02-08 11:02:40.674370000 +0100
+++ html.php        2004-02-08 11:39:48.874370000 +0100
@@ -159,12 +159,16 @@
     function header()
     {
         global $registry;
+        global $refresh_time;
+        global $refresh_url;

         $pres = $this->presentation->get_pres_info();
         $title = $pres['slides'][$this->slide]['title'];
         $max = count($pres['slides']);
         if ($this->slide != $max - 1) {
             $nt = $pres['slides'][$this->slide + 1]['title'];
+            $refresh_time = $pres['slides'][$this->slide]['duration'];
+            $refresh_url = $this->getNext($pres['slides'][$this->slide +
1]['src']);
         } else {
             $nt = '';
         }


--- common-header.incr        2004-02-08 11:02:50.064370000 +0100
+++ common-header.inc        2004-02-08 11:42:44.284370000 +0100
@@ -14,7 +14,9 @@

 $page_title = $GLOBALS['registry']->getParam('name');
 if (!empty($title)) $page_title .= ' :: ' . $title;
-if (!empty($refresh_time) && ($refresh_time > 0) && !empty($refresh_url)) {
+if (!empty($GLOBALS['refresh_time']) && ($GLOBALS['refresh_time'] > 0) &&
!empty($GLOBALS['refresh_url'])) {
+    $refresh_time = $GLOBALS['refresh_time'];
+    $refresh_url = $GLOBALS['refresh_url'];
     echo "<meta http-equiv=\\"refresh\\"
content=\\"$refresh_time;url=$refresh_url\\" />\\n";
 }
        



More information about the dev mailing list