Changeset 1142

Show
Ignore:
Timestamp:
06/10/2008 02:11:08 AM (2 years ago)
Author:
DotMG
Message:

refs #753. Porting [1089], [1090], [1094] and [1104] to trunk.

+ adding phpDocumentor cross-refs (@uses).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/actions/adminusers/adminusers.php

    r1106 r1142  
    1717 * @since               Wikka 1.1.6.4 
    1818 * 
     19 * @uses Wakka::Action() 
     20 * @uses Wakka::ExistsPage() 
     21 * @uses Wakka::FormClose() 
     22 * @uses Wakka::FormOpen() 
     23 * @uses Wakka::getCount() 
     24 * @uses Wakka::GetUser() 
     25 * @uses Wakka::Href() 
     26 * @uses Wakka::htmlspecialchars_ent() 
     27 * @uses Wakka::IsAdmin() 
     28 * @uses Wakka::Link() 
     29 * @uses Wakka::LoadAll() 
     30 * @uses Wakka::Redirect() 
     31 * 
     32 * @uses Config::$wikka_action_path 
     33 *  
    1934 * @input               integer $colcolor  optional: enables color for statistics columns 
    2035 *                              1: enable colored columns; 
     
    168183        define('ADMINUSERS_FORM_MASSACTION_SUBMIT','Submit'); 
    169184        define('ADMINUSERS_ERROR_NO_MATCHES','Sorry, there are no users matching "%s"'); 
     185        define('ADMINUSERS_DELETE_USERS_HEADING', 'Delete these users?'); 
     186        define('ADMINUSERS_DELETE_USERS_BUTTON', 'Delete Users'); 
     187        define('ADMINUSERS_CANCEL_BUTTON', 'Cancel'); #TODO: replace with appropriate constant from language file! 
    170188 
    171189        //initialize row & column colors variables 
     
    197215         
    198216        //perform actions if required 
    199         if ($_GET['action'] == 'owned')  
     217        $g_action = ''; 
     218        if(isset($_GET['action'])) 
     219        { 
     220                $g_action = $_GET['action']; 
     221        } 
     222        if($g_action == 'owned')  
    200223        { 
    201224                echo $this->Action('mypages'); 
    202225        }  
    203         elseif ($_GET['action'] == 'changes')  
     226        elseif($g_action == 'changes')  
    204227        { 
    205228                echo $this->Action('mychanges'); 
    206229        }  
    207         elseif ($_GET['action'] == 'comments')  
     230        elseif($g_action == 'comments')  
    208231        { 
    209232                echo $this->Action('recentcomments'); 
    210233        }  
    211234        /* 
    212         elseif ($_GET['action'] == 'feedback' || $_REQUEST['mail'])  
     235        elseif ($g_action == 'feedback' || $_REQUEST['mail'])  
    213236        { 
    214237                echo $this->Action('userfeedback'); #to be added in 1.1.7, see #608 
    215238        } 
    216239        */ 
    217         elseif($_GET['action'] == 'delete') 
     240        elseif($g_action == 'delete') 
    218241        { 
    219242                if(isset($_GET['user'])) 
     
    228251                        else 
    229252                        { 
    230                                 $this->Redirect($this->Href()); 
    231                         } 
    232                 } 
    233         } 
    234         else if($_GET['action'] == 'massdelete') 
     253                                $this->Redirect($this->Href(), USERDELETE_MESSAGE_SUCCESS); 
     254                        } 
     255                } 
     256        } 
     257        else if($g_action == 'massdelete') 
    235258        { 
    236259                $usernames = array(); 
     
    244267                if(count($usernames) > 0) 
    245268                { 
    246                         ?> 
    247                         <h3>Delete these users?</h3><br/> 
    248                         <ul> 
    249                         <?php 
     269                        echo '<h3>'.ADMINUSERS_DELETE_USERS_HEADING.'</h3><br />'."\n".'<ul>'; 
    250270                        $errors = 0; 
    251271                        foreach($usernames as $username) 
     
    254274                                { 
    255275                                        ++$errors; 
    256                                         echo "<li><span class='disabled'>".$username."&nbsp;</span><em class='error'>(".ADMINUSERS_FORM_MASSACTION_DELETE_ERROR.")</em></li>\n"; 
     276                                        echo '<li><span class="disabled">'.$username.'&nbsp;</span><em class="error">('.ADMINUSERS_FORM_MASSACTION_DELETE_ERROR.")</em></li>\n"; 
    257277                                        continue; 
    258278                                } 
     
    280300                                                <input type="hidden" name="massaction" value="massdelete"/> 
    281301                                                <?php if($errors < count($usernames)) { ?> 
    282                                                 <input type="submit" value="Delete Users"  style="width: 120px"   /> 
     302                                                <input type="submit" value="<?php echo ADMINUSERS_DELETE_USERS_BUTTON;?>"  style="width: 120px"   /> 
    283303                                                <?php } ?> 
    284                                                 <input type="button" value="Cancel" onclick="history.back();" style="width: 120px" /> 
     304                                                <input type="button" value="<?php echo ADMINUSERS_CANCEL_BUTTON;?>" onclick="history.back();" style="width: 120px" /> 
    285305                                        </td> 
    286306                                </tr> 
     
    315335                else 
    316336                { 
    317                         $this->Redirect($this->Href()); 
     337                        $this->Redirect($this->Href(), USERDELETE_MESSAGE_SUCCESS); 
    318338                } 
    319339        } 
     
    345365         
    346366                // search string 
     367                $q = ''; 
    347368                if (isset($_POST['q'])) 
    348369                { 
     
    353374                        $q = $_GET['q']; 
    354375                } 
    355                 elseif($_POST['submit'] == ADMINUSERS_FORM_SEARCH_SUBMIT) 
     376                elseif(isset($_POST['submit']) && $_POST['submit'] == ADMINUSERS_FORM_SEARCH_SUBMIT) 
    356377                { 
    357378                        // Reset num recs per page for empty (reset) search 
     
    376397                // (search string, num recs per page) get out of sync, requiring 
    377398                // multiple submissions. 
    378                 if(!isset($_GET['l']) && $_POST['submit'] != ADMINUSERS_FORM_PAGER_SUBMIT) 
     399                if(!isset($_GET['l']) && isset($_POST['submit']) && $_POST['submit'] != ADMINUSERS_FORM_PAGER_SUBMIT) 
    379400                { 
    380401                        $l = ADMINUSERS_DEFAULT_RECORDS_LIMIT; 
     
    383404                // print page header 
    384405                echo '<h3>'.ADMINUSERS_PAGE_TITLE.'</h3>'."\n"; 
    385                 $msg = ''; 
    386                 if($msg = $this->GetRedirectMessage()) 
    387                 { 
    388                         echo '<p><em class="error">'.sprintf($msg).'</em></p>'; 
    389                 } 
    390          
     406 
     407                //non-working message retrieval removed, see #753 
    391408                // build pager form      
    392409                $form_filter = $this->FormOpen('','','post','user_admin_panel');