Changeset 7681 for trunk/filemanager


Ignore:
Timestamp:
12/19/12 16:44:18 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Correcoes para Best Practice: Short Open Tag e Best Practice: Always Quote Array Keys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/filemanager/inc/class.uifilemanager.inc.php

    r7673 r7681  
    155155                // check if basedir exist  
    156156                $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    157                 if ($test[mime_type] != 'Directory') { 
     157                if ($test['mime_type'] != 'Directory') { 
    158158                        die('Base directory does not exist, Ask adminstrator to check the global configuration.'); 
    159159                } 
    160160 
    161161                $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir . $this->bo->fakebase, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    162                 if ($test[mime_type] != 'Directory') { 
     162                if ($test['mime_type'] != 'Directory') { 
    163163                        $this->bo->vfs->override_acl = 1; 
    164164 
     
    173173                        $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir . $this->bo->fakebase, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    174174 
    175                         if ($test[mime_type] != 'Directory') { 
     175                        if ($test['mime_type'] != 'Directory') { 
    176176                                die('Fake Base directory does not exist and could not be created, please ask the administrator to check the global configuration.'); 
    177177                        } else { 
     
    181181 
    182182                $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir . $this->bo->homedir, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    183                 if ($test[mime_type] != 'Directory') { 
     183                if ($test['mime_type'] != 'Directory') { 
    184184                         
    185185                        $c_admin = CreateObject('phpgwapi.config', 'expressoAdmin1_2'); 
     
    205205                        $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir . $this->bo->homedir, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    206206 
    207                         if ($test[mime_type] != 'Directory') { 
     207                        if ($test['mime_type'] != 'Directory') { 
    208208                                die('Your Home Dir does not exist and could not be created, please ask the adminstrator to check the global configuration.'); 
    209209                        } else { 
     
    622622 
    623623                if ($this->numoffiles || $this->cwd) { 
    624                         $vars[path] = '<input type="hidden" id="currentPath" value="' . $this->path . '">'; 
    625                         $vars[css] = '<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">'; 
    626                         $vars[css].='<link rel="stylesheet" type="text/css" href="phpgwapi/js/dftree/dftree.css">'; 
     624                        $vars['path'] = '<input type="hidden" id="currentPath" value="' . $this->path . '">'; 
     625                        $vars['css'] = '<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">'; 
     626                        $vars['css'].='<link rel="stylesheet" type="text/css" href="phpgwapi/js/dftree/dftree.css">'; 
    627627                        $_SESSION['phpgw_info']['user']['preferences']['filemanager']['lid'] = $GLOBALS['phpgw_info']['user']['account_lid']; 
    628                         $vars[preferences] = '<input type="hidden" id="userPreferences" value=\'' . serialize($_SESSION['phpgw_info']['user']['preferences']['filemanager']) . '\'>'; 
     628                        $vars['preferences'] = '<input type="hidden" id="userPreferences" value=\'' . serialize($_SESSION['phpgw_info']['user']['preferences']['filemanager']) . '\'>'; 
    629629                        // Used for important operations that needs security 
    630630                        for ($key = ""; strlen($key) < 150; $key .= chr(rand(48, 95))) 
    631631                                ; 
    632632                        $_SESSION['phpgw_info']['filemanager']['user']['sec_key'] = $key; 
    633                         $vars[sec_key] = '<input type="hidden" id="userKey" value=\'' . $key . '\'>'; 
    634                         $vars[script] = '<script>initDrawApi();</script>'; 
    635  
    636                         $vars[new_button] = $this->toolButton('new', 'createfile', lang('New...')); 
    637                         $vars[new_button].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />'; 
     633                        $vars['sec_key'] = '<input type="hidden" id="userKey" value=\'' . $key . '\'>'; 
     634                        $vars['script'] = '<script>initDrawApi();</script>'; 
     635 
     636                        $vars['new_button'] = $this->toolButton('new', 'createfile', lang('New...')); 
     637                        $vars['new_button'].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />'; 
    638638 
    639639                        // reload button with this url 
    640                         $vars[refresh_button] = $this->toolButton('reload', 'reload', lang('reload')); 
     640                        $vars['refresh_button'] = $this->toolButton('reload', 'reload', lang('reload')); 
    641641 
    642642                        // go up icon when we're not at the top, dont allow to go outside /home = fakebase 
    643643                        if ($this->path != '/' && $this->path != $this->bo->fakebase) { 
    644                                 $vars[tools_button] = $this->toolButton('tools', 'tools', lang('tools')); 
     644                                $vars['tools_button'] = $this->toolButton('tools', 'tools', lang('tools')); 
    645645                        } 
    646646                        else 
    647                                 $vars[tools_button] = ""; 
    648  
    649                         $vars[toolbar1] = $toolbar; 
     647                                $vars['tools_button'] = ""; 
     648 
     649                        $vars['toolbar1'] = $toolbar; 
    650650 
    651651                        if (count($this->messages) > 0) { 
     
    656656                        $this->messages = NULL; 
    657657 
    658                         $vars[messages] = $messages; 
     658                        $vars['messages'] = $messages; 
    659659 
    660660                        $this->t->set_var($vars); 
     
    815815                $var = array( 
    816816                         'change_upload_boxes'  => lang('Show'), 
    817                          'form_action'                  => $GLOBALS[phpgw]->link('/filemanager/inc/upload.php'), 
     817                         'form_action'                  => $GLOBALS['phpgw']->link('/filemanager/inc/upload.php'), 
    818818                         'emails_to'                            => $notify->EmailsToSend($GLOBALS['phpgw']->preferences->values['email']), 
    819819                         'lang_file'                            => lang('File(s)'), 
     
    906906 
    907907 
    908                 $vars[refresh_script] = "<script src='filemanager/js/refresh.js'></script>"; 
    909  
    910                 $vars[preview_content] = ''; 
     908                $vars['refresh_script'] = "<script src='filemanager/js/refresh.js'></script>"; 
     909 
     910                $vars['preview_content'] = ''; 
    911911                if ($this->edit_file) { 
    912912                        $this->edit_file_content = stripslashes($this->edit_file_content); 
     
    916916                        $content = $this->edit_file_content; 
    917917 
    918                         $vars[lang_preview_of] = lang('Preview of %1', $this->path . '/' . $edit_file); 
    919  
    920                         $vars[preview_content] = nl2br($content); 
     918                        $vars['lang_preview_of'] = lang('Preview of %1', $this->path . '/' . $edit_file); 
     919 
     920                        $vars['preview_content'] = nl2br($content); 
    921921                } elseif ($this->edit_save_x || $this->edit_save_done_x) { 
    922922                        $content = $this->edit_file_content; 
     
    954954                                $content = $this->bo->vfs->read(array('string' => $this->filename)); 
    955955                        } 
    956                         $vars[form_action] = $GLOBALS['phpgw']->link('/index.php', 'menuaction=filemanager.uifilemanager.index', 'path=' . $this->path); 
    957                         $vars[edit_file] = $this->filename; 
     956                        $vars['form_action'] = $GLOBALS['phpgw']->link('/index.php', 'menuaction=filemanager.uifilemanager.index', 'path=' . $this->path); 
     957                        $vars['edit_file'] = $this->filename; 
    958958                        # We need to include all of the fileman entries for each file's form, 
    959959                        # so we loop through again 
     
    961961                                if ($this->filename) 
    962962                                        $value = 'value="' . $this->filename . '"'; 
    963                                 $vars[filemans_hidden] = '<input type="hidden" name="filename" ' . $value . ' />'; 
    964                         } 
    965                         $vars[file_content] = $content; 
    966  
    967                         $vars[buttonPreview] = $this->inputButton('edit_preview', 'edit_preview', lang('Preview %1', $this->bo->html_encode($this->fileman[0], 1))); 
    968                         $vars[buttonSave] = $this->inputButton('edit_save', 'save', lang('Save %1', $this->bo->html_encode($this->filename, 1))); 
    969                         $vars[buttonDone] = $this->inputButton('edit_save_done', 'ok', lang('Save %1, and go back to file listing ', $this->bo->html_encode($this->filename, 1))); 
    970                         $vars[buttonCancel] = $this->inputButton('edit_cancel', 'cancel', lang('Cancel editing %1 without saving', $this->bo->html_encode($this->filename, 1))); 
     963                                $vars['filemans_hidden'] = '<input type="hidden" name="filename" ' . $value . ' />'; 
     964                        } 
     965                        $vars['file_content'] = $content; 
     966 
     967                        $vars['buttonPreview'] = $this->inputButton('edit_preview', 'edit_preview', lang('Preview %1', $this->bo->html_encode($this->fileman[0], 1))); 
     968                        $vars['buttonSave'] = $this->inputButton('edit_save', 'save', lang('Save %1', $this->bo->html_encode($this->filename, 1))); 
     969                        $vars['buttonDone'] = $this->inputButton('edit_save_done', 'ok', lang('Save %1, and go back to file listing ', $this->bo->html_encode($this->filename, 1))); 
     970                        $vars['buttonCancel'] = $this->inputButton('edit_cancel', 'cancel', lang('Cancel editing %1 without saving', $this->bo->html_encode($this->filename, 1))); 
    971971 
    972972                        if ($mime_type == 'text/html') { 
    973                                 $vars[fck_edit] = '<script type="text/javascript" src="./library/ckeditor/ckeditor.js"></script> 
     973                                $vars['fck_edit'] = '<script type="text/javascript" src="./library/ckeditor/ckeditor.js"></script> 
    974974                                        <textarea cols="80" id="edit_file_content" name="edit_file_content" rows="10">' . $content . '</textarea> 
    975975                                                <script type="text/javascript"> CKEDITOR.replace( \'edit_file_content\',{ 
     
    11441144                        $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->fakebase . '/' . $group_array['account_name'], 
    11451145                                                        'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    1146                         if ($test[mime_type] != 'Directory') { 
     1146                        if ($test['mime_type'] != 'Directory') { 
    11471147                                continue; 
    11481148                        } 
Note: See TracChangeset for help on using the changeset viewer.