Changeset 300

Show
Ignore:
Timestamp:
04/21/08 22:09:04 (7 months ago)
Author:
rho
Message:

[shouts] added option to show sidebar form and shouts form keyword

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • shouts/trunk/lib.php

    r299 r300  
    1212 
    1313    define('SHOUTS_PER_PAGE', 10); 
     14    define('SHOUTS_SIDEBAR_FORM', true); 
    1415    define('LIMIT_SHOUT_TEXT', 140); 
    1516 
     
    139140        $title = __gettext('Shouts'); 
    140141 
    141         if (permissions_check('profile', page_owner())) { 
     142        if (SHOUTS_SIDEBAR_FORM && permissions_check('profile', page_owner())) { 
    142143            $quick_add = pages_html_a('javascript:void(0);', 
    143144                __gettext('(add)'), 
    144145                array( 
    145                     'onclick'=>"shouts_toggle('shouts-form-sidebar');"
     146                    'onclick'=>'shouts_toggle("shouts-form-sidebar");'
    146147                )); 
    147148        } else { 
     
    159160 
    160161        // add form 
    161         $shouts_index = $CFG->wwwroot . 'mod/shouts/index.php'
     162        $shouts_index = get_url(page_owner(), 'shouts::')
    162163        $body .= shouts_get_add_form($shouts_index, 'sidebar'); 
    163164 
     
    560561        } 
    561562    } 
     563    // display form 
     564    elseif ($owner == 'form') { 
     565        $result = shouts_get_add_form(get_url($_SESSION['userid'], 'shouts::')); 
     566    } 
    562567 
    563568    return $result;