Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.180 and 1.184

version 1.180, 2008/09/05 22:12:47 version 1.184, 2008/11/21 15:22:04
Line 102  can be used to paste LaTeX into a textar Line 102  can be used to paste LaTeX into a textar
 =cut  =cut
   
 sub dragmath_js {  sub dragmath_js {
       my ($popup) = @_;
     return <<ENDDRAGMATHJS;      return <<ENDDRAGMATHJS;
                 <script type="text/javascript">                  <script type="text/javascript">
                   function mathedit(textarea, doc) {                    function mathedit(textarea, doc) {
                      targetEntry = textarea;                       targetEntry = textarea;
                      targetDoc   = doc;                       targetDoc   = doc;
                      newwin  = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable");                       newwin  = window.open("/adm/dragmath/applet/$popup.html","","width=565,height=500,resizable");
                   }                    }
                 </script>                  </script>
   
 ENDDRAGMATHJS  ENDDRAGMATHJS
 }  }
   
   
 ##############################################  ##############################################
 ##############################################  ##############################################
   
Line 1483  END Line 1485  END
     return $output;      return $output;
 }  }
   
   sub row_headline {
       my $output = <<"END";
              <tr><td colspan="2">
   END
       return $output;
   }
   
 sub row_title {  sub row_title {
     my ($title,$css_title_class,$css_value_class) = @_;      my ($title,$css_title_class,$css_value_class) = @_;
     $css_title_class ||= 'LC_pick_box_title';      $css_title_class ||= 'LC_pick_box_title';
Line 1995  END Line 2004  END
     return $scripttag;      return $scripttag;
 }  }
   
   ##############################################
   ##############################################
   
   # generate_menu
   #
   # Generates html markup for a menu. 
   #
   # Inputs:
   # An array of following structure:
   #   ({ categorytitle => 'Categorytitle',
   # items => [
   #    { linktext    => 'Text to be displayed',
   # url    => 'URL the link is pointing to, i.e. /adm/site?action=dosomething',
   # permission  => 'Contains permissions as returned from lonnet::allowed(),
   # must evaluate to true in order to activate the link',
   # icon        =>  'icon filename',
   # help    => 'Name of the corresponding helpfile',
   # linktitle   => 'Description of the link (used for title tag)'
   #    },
   #    ...
   # ]
   #   }, 
   #   ...
   #   )
   #
   # Outputs: A scalar containing the html markup for the menu.
   
   # ---- Remove when done ----
   # This routine is part of the redesign of LON-CAPA and it's 
   # subject to change during this project.
   # Don't rely on its current functionality as it might be 
   # changed or removed.
   # TODO:
   # add icon field
   # add alt tag for icon
   # check for empty values
   # --------------------------
   
   sub generate_menu {
       my @menu = @_;
       my $menu_html = '';
   
       foreach my $category (@menu) { #FIXME: insert appropriate classnames for styles when they're finished.
    $menu_html .='<div class="DivContentBox"><h3 class="">'.$category->{'categorytitle'}.'</h3><ul class="ListStyleNormal">';
    foreach my $item (@{ $category->{items} }) {
       next if (! $item->{'permission'});
       $menu_html .= '<li class="">'.
       qq{<a href="$item->{'url'}" title="$item->{'linktitle'}">};
               if($item->{'icon'}){
                   $menu_html .= qq{<img class = "" src="/res/adm/pages/$item->{'icon'}" alt=""/>} 
               }
               $menu_html .= &mt($item->{'linktext'}).'</a>';
   #    if (exists($item->{'help'})) {
   # $menu_html .= &Apache::loncommon::help_open_topic($item->{'help'});
   #    }
       $menu_html .= '</li>';
    }
    $menu_html .= '</div>';
       }
       return $menu_html;
   }
   
   
 1;  1;

Removed from v.1.180  
changed lines
  Added in v.1.184


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>