Changeset 413 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Oct 2, 2012 1:57:05 PM (12 years ago)
Author:
anonymous
Message:

Added header and footer to docs/examples. Updated message printing methods to include before, after, and gotohash options. Minor other fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r410 r413  
    492492     * Prints the HTML for displaying raised messages.
    493493     *
     494     * @param   string  $above    Additional message to print above error messages (e.g. "Oops!").
     495     * @param   string  $below    Additional message to print below error messages (e.g. "Please fix and resubmit").
     496     * @param   string  $print_gotohash_js  Print a line of javascript that scrolls the browser window down to view any error messages.
     497     * @param   string  $hash     The #hashtag to scroll to.
    494498     * @access  public
    495499     * @author  Quinn Comendant <quinn@strangecode.com>
    496500     * @since   15 Jul 2005 01:39:14
    497501     */
    498     function printRaisedMessages()
     502    function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg')
    499503    {
    500504        if (!$this->running) {
     
    506510        if (!empty($messages)) {
    507511            ?><div id="sc-msg" class="sc-msg"><?php
     512            if ('' != $above) {
     513                ?><div class="sc-above"><?php echo oTxt($above); ?></div><?php
     514            }
    508515            foreach ($messages as $m) {
    509516                if (error_reporting() > 0 && $this->getParam('display_errors') && isset($m['file']) && isset($m['line'])) {
     
    530537                }
    531538            }
     539            if ('' != $below) {
     540                ?><div class="sc-below"><?php echo oTxt($below); ?></div><?php
     541            }
    532542            ?></div><?php
     543            if ($print_gotohash_js) {
     544                ?>
     545                <script type="text/javascript">
     546                /* <![CDATA[ */
     547                window.location.hash = '#<?php echo urlencode($hash); ?>';
     548                /* ]]> */
     549                </script>
     550                <?php
     551            }
    533552        }
    534553        $this->clearRaisedMessages();
Note: See TracChangeset for help on using the changeset viewer.