Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/obinary/cms/taglibs/AdminOnly.java


1   /**
2    *
3    * Magnolia and its source-code is licensed under the LGPL.
4    * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5    * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6    * you are required to provide proper attribution to obinary.
7    * If you reproduce or distribute the document without making any substantive modifications to its content,
8    * please use the following attribution line:
9    *
10   * Copyright 1993-2003 obinary Ltd. (http://www.obinary.com) All rights reserved.
11   *
12   * */
13  
14  
15  
16  
17  
18  
19  package com.obinary.cms.taglibs;
20  
21  
22  import com.obinary.cms.beans.ServerInfo;
23  import com.obinary.cms.util.Resource;
24  
25  import javax.servlet.jsp.tagext.TagSupport;
26  import javax.servlet.http.HttpServletRequest;
27  
28  
29  /**
30   * Date: Apr 28, 2003
31   * Time: 11:20:59 AM
32   * @author Sameer Charles
33   * @version 1.0
34   */
35  
36  
37  
38  public class AdminOnly extends TagSupport {
39  
40  
41  
42      /**
43       * <p>starts Edit tag</p>
44       *
45       * @return int
46       */
47      public int doStartTag() {
48          if (ServerInfo.isAdmin() && !Resource.showPreview((HttpServletRequest)pageContext.getRequest()))
49              return EVAL_BODY_INCLUDE;
50          return SKIP_BODY;
51      }
52  
53  
54  
55      /**
56       * <p>continue evaluating jsp</p>
57       *
58       * @return int
59       */
60      public int doEndTag() {
61          return EVAL_PAGE;
62      }
63  
64  
65  
66  }