+ if (array_key_exists ('info-text',$this->options)) {
+ $id=$this->id;
+ $html .= "<span class='toggle-info-button' onClick='pletoggle_toggle_info(\"$id\");'><img height=20 src='/planetlab/icons/info.png' alt='close info'/></span>";
+ }
+ return $html;
+ }
+
+ function info() { print $this->info_html();}
+ function info_html () {
+ if (! array_key_exists ('info-text',$this->options)) return "";
+
+ // compute if info should be visible at startup
+ // xxx in fact the default should be fetched in the browser storage xxx
+ $info_visible=TRUE;
+ // if info-visible is set, use this value
+ if (array_key_exists ('info-visible',$this->options))
+ $info_visible=$this->options['info-visible'];
+
+ $id=$this->id;
+ $div_id=$this->id_name('info');
+ $html="";
+ $html .= "<div class='toggle-info'";
+ $html .= " id='$div_id'";
+ if (!$info_visible) $html .= " style='display:none'";
+ $html .= ">";
+ // tmp
+ $html .= "<table class='center'><tr><td class='top'>";
+ $html .= $this->options['info-text'];
+ $html .= "</td><td class='top'><span onClick='pletoggle_toggle_info(\"$id\");'><img height=20 class='reset' src='/planetlab/icons/close.png' alt='toggle info' /></span>";
+ $html .= "</td></tr></table></div>";