本文整理汇总了PHP中ext_Lang::msg方法的典型用法代码示例。如果您正苦于以下问题:PHP ext_Lang::msg方法的具体用法?PHP ext_Lang::msg怎么用?PHP ext_Lang::msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ext_Lang
的用法示例。
在下文中一共展示了ext_Lang::msg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_about
/**
* @version $Id: footer.php 107 2008-07-22 17:27:12Z soeren $
* @package eXtplorer
* @copyright soeren 2007
* @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
* @author The The QuiX project (http://quixplorer.sourceforge.net)
*
* @license
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU General Public License Version 2 or later (the "GPL"), in
* which case the provisions of the GPL are applicable instead of
* those above. If you wish to allow use of your version of this file only
* under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this file
* under either the MPL or the GPL."
*
* Shows the About Box!
*/
function show_about()
{
// footer for html-page
echo "\n<div id=\"ext_footer\" style=\"text-align:center;\">\r\n\t<img src=\"" . _EXT_URL . "/images/MangosWeb_small.png\" align=\"middle\" alt=\"Mangosweb Enhanced Logo\" />\r\n\t<br />\r\n\t" . ext_Lang::msg('your_version') . ": <a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\">eXtplorer {$GLOBALS['ext_version']}</a>\r\n\t<br />\r\n (<a href=\"http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "\" onclick=\"javascript:void window.open('http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=580,directories=no,location=no'); return false;\" title=\"" . $GLOBALS["messages"]["check_version"] . "\">" . $GLOBALS["messages"]["check_version"] . "</a>)\r\n\t\r\n\t";
if (function_exists("disk_free_space")) {
$size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} elseif (function_exists("diskfreespace")) {
$size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} else {
$free = "?";
}
echo '<br />' . $GLOBALS["messages"]["miscfree"] . ": " . $free . " \n";
if (extension_loaded("posix")) {
$owner_info = '<br /><br />' . ext_Lang::msg('current_user') . ' ';
if (ext_isFTPMode()) {
$my_user_info = posix_getpwnam($_SESSION['ftp_login']);
$my_group_info = posix_getgrgid($my_user_info['gid']);
} else {
$my_user_info = posix_getpwuid(posix_geteuid());
$my_group_info = posix_getgrgid(posix_getegid());
}
$owner_info .= $my_user_info['name'] . ' (' . $my_user_info['uid'] . '), ' . $my_group_info['name'] . ' (' . $my_group_info['gid'] . ')';
echo $owner_info;
}
echo "\r\n\t</div>";
}
示例2: execAction
function execAction($dir, $item)
{
if (!ext_isArchive($item)) {
ext_Result::sendResult('archive', false, $item . ': ' . ext_Lang::err('extract_noarchive'));
} else {
// CSRF Security Check
if (!ext_checkToken($GLOBALS['__POST']["token"])) {
ext_Result::sendResult('tokencheck', false, 'Request failed: Security Token not valid.');
}
$archive_name = realpath(get_abs_item($dir, $item));
if (empty($dir)) {
$extract_dir = realpath($GLOBALS['home_dir']);
} else {
$extract_dir = realpath($GLOBALS['home_dir'] . "/" . $dir);
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
$res = extArchive::extract($archive_name, $extract_dir);
if (PEAR::isError($res)) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure') . ' - ' . $res->getMessage());
}
if ($res === false) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure'));
} else {
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
}
示例3: execAction
function execAction($dir, $item)
{
if (!ext_isArchive($item)) {
ext_Result::sendResult('archive', false, $item . ': ' . ext_Lang::err('extract_noarchive'));
} else {
$archive_name = realpath(get_abs_item($dir, $item));
if (empty($dir)) {
$extract_dir = realpath($GLOBALS['home_dir']);
} else {
$extract_dir = realpath($GLOBALS['home_dir'] . "/" . $dir);
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
$res = extArchive::extract($archive_name, $extract_dir);
if (PEAR::isError($res)) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure') . ' - ' . $res->getMessage());
}
if ($res === false) {
ext_Result::sendResult('extract', false, ext_Lang::err('extract_failure'));
} else {
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
ext_Result::sendResult('extract', true, ext_Lang::msg('extract_success'));
}
}
示例4: show_searchform
function show_searchform($dir = '')
{
?>
{
"height":400,
"autoScroll":true,
items: [
new Ext.TabPanel({
activeTab: 0,
items: [{
"title":"<?php
echo $GLOBALS["messages"]["searchlink"];
?>
",
"height": "370",
"autoScroll":true,
"items":
new Ext.DataView({
"id": "dataview",
tpl: new Ext.XTemplate(
'<tpl for=".">',
'<div class="search-item">',
'<h3>',
'<a onclick="selectFile(\'{dir}\', \'{file}\');Ext.getCmp(\'dialog\').destroy();return false;" href="#" target="_blank">{s_dir}/{file}, {lastModified:date("M j, Y")}</a>',
'</h3>',
'</div></tpl>'
),
store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: "<?php
echo $GLOBALS['script_name'];
?>
"
}),
reader: new Ext.data.JsonReader({
root: 'items',
totalProperty: 'totalCount',
id: 'file_id'
}, [
{name: 'fileId', mapping: 'file_id'},
{name: 'file', mapping: 'file'},
{name: 'dir', mapping: 'dir'},
{name: 's_dir', mapping: 's_dir'},
{name: 'lastModified', mapping: 'last_mtime', type: 'date', dateFormat: 'timestamp'}
]),
baseParams: {
limit:20,
option: "com_extplorer",
action:"search",
dir: "<?php
echo $dir;
?>
",
content: '0',
subdir: '1'
}
}),
itemSelector: 'div.search-item'
}),
tbar: [
'Search: ', ' ',
new Ext.app.SearchField({
store: Ext.getCmp("dataview").store,
width:320,
value: "*"
})
],
bbar: new Ext.PagingToolbar({
store: Ext.getCmp("dataview").store,
pageSize: 20,
displayInfo: true,
displayMsg: 'Results {0} - {1} of {2}',
emptyMsg: "No files to display"
})
},
{
title: "Search Options",
xtype:"form",
layout: "form",
"height": "350",
items: [
{
id:'myGroup',
xtype: 'checkboxgroup',
fieldLabel: 'Extensive Search',
itemCls: 'x-check-group-alt',
// Put all controls in a single column with width 100%
columns: 1,
items: [
{
boxLabel: 'Search within Subdirectories?', name: 'subdir',
checked: true,
tooltip: "<?php
echo ext_Lang::msg('miscsubdirs', true);
?>
?",
//.........这里部分代码省略.........
示例5: onShowLoginForm
function onShowLoginForm($User, $Pass)
{
?>
{
xtype: "form",
<?php
if (!ext_isXHR()) {
?>
renderTo: "adminForm", <?php
}
?>
title: "<?php
echo ext_Lang::msg('actlogin');
?>
",
id: "simpleform",
labelWidth: 125, // label settings here cascade unless overridden
url: "<?php
echo basename($GLOBALS['script_name']);
?>
",
frame: true,
keys: {
key: Ext.EventObject.ENTER,
fn : function(){
if (simple.getForm().isValid()) {
Ext.get( "statusBar").update( "Please wait..." );
Ext.getCmp("simpleform").getForm().submit({
reset: false,
success: function(form, action) { location.reload() },
failure: function(form, action) {
if( !action.result ) return;
Ext.Msg.alert('<?php
echo ext_Lang::err('error', true);
?>
', action.result.error, function() {
this.findField( 'password').setValue('');
this.findField( 'password').focus();
}, form );
Ext.get( 'statusBar').update( action.result.error );
},
scope: Ext.getCmp("simpleform").getForm(),
params: {
option: "com_extplorer",
action: "login",
type : "extplorer"
}
});
} else {
return false;
}
}
},
items: [{
xtype:"textfield",
fieldLabel: "<?php
echo ext_Lang::msg('miscusername', true);
?>
",
name: "username",
value: "<?php
echo $User;
?>
",
width:175,
allowBlank:false
},{
xtype:"textfield",
fieldLabel: "<?php
echo ext_Lang::msg('miscpassword', true);
?>
",
name: "password",
value: "<?php
echo $Pass;
?>
",
inputType: "password",
width:175,
allowBlank:false
}, new Ext.form.ComboBox({
fieldLabel: "<?php
echo ext_Lang::msg('misclang', true);
?>
",
store: new Ext.data.SimpleStore({
fields: ['language', 'langname'],
data : [
<?php
$langs = get_languages();
$i = 0;
$c = count($langs);
foreach ($langs as $language => $name) {
echo "['{$language}', '{$name}' ]";
if (++$i < $c) {
echo ',';
}
}
?>
//.........这里部分代码省略.........
示例6: execAction
function execAction($dir)
{
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('upload', false, ext_Lang::err('accessfunc'));
}
// Execute
if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
if (isset($GLOBALS['__FILES']['Filedata'])) {
// Re-Map the flash-uploaded file with the name "Filedata" to the "userfile" array
$GLOBALS['__FILES']['userfile'] = array('name' => array($GLOBALS['__FILES']['Filedata']['name']), 'tmp_name' => array($GLOBALS['__FILES']['Filedata']['tmp_name']), 'size' => array($GLOBALS['__FILES']['Filedata']['size']), 'type' => array($GLOBALS['__FILES']['Filedata']['type']), 'error' => array($GLOBALS['__FILES']['Filedata']['error']));
}
$cnt = count($GLOBALS['__FILES']['userfile']['name']);
$err = false;
$err_available = isset($GLOBALS['__FILES']['userfile']['error']);
// upload files & check for errors
for ($i = 0; $i < $cnt; $i++) {
$errors[$i] = NULL;
$tmp = $GLOBALS['__FILES']['userfile']['tmp_name'][$i];
$items[$i] = stripslashes($GLOBALS['__FILES']['userfile']['name'][$i]);
if ($err_available) {
$up_err = $GLOBALS['__FILES']['userfile']['error'][$i];
} else {
$up_err = file_exists($tmp) ? 0 : 4;
}
$abs = get_abs_item($dir, $items[$i]);
if ($items[$i] == "" || $up_err == 4) {
continue;
}
if ($up_err == 1 || $up_err == 2) {
$errors[$i] = ext_lang::err('miscfilesize');
$err = true;
continue;
}
if ($up_err == 3) {
$errors[$i] = ext_lang::err('miscfilepart');
$err = true;
continue;
}
if (!@is_uploaded_file($tmp)) {
$errors[$i] = ext_lang::err('uploadfile');
$err = true;
continue;
}
if (@file_exists($abs) && empty($_REQUEST['overwrite_files'])) {
$errors[$i] = ext_lang::err('itemdoesexist');
$err = true;
continue;
}
// Upload
$ok = @$GLOBALS['ext_File']->move_uploaded_file($tmp, $abs);
if ($ok === false || PEAR::isError($ok)) {
$errors[$i] = ext_lang::err('uploadfile');
if (PEAR::isError($ok)) {
$errors[$i] .= ' [' . $ok->getMessage() . ']';
}
$err = true;
continue;
} else {
if (!ext_isFTPMode()) {
@$GLOBALS['ext_File']->chmod($abs, 0644);
}
}
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; $i++) {
if ($errors[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $errors[$i] . "\n";
}
ext_Result::sendResult('upload', false, $err_msg);
}
ext_Result::sendResult('upload', true, ext_Lang::msg('upload_completed'));
return;
}
?>
{
"xtype": "tabpanel",
"stateId": "upload_tabpanel",
"activeTab": "uploadform",
"dialogtitle": "<?php
echo ext_Lang::msg('actupload');
?>
",
"stateful": "true",
"stateEvents": ["tabchange"],
"getState": function() { return {
activeTab:this.items.indexOf(this.getActiveTab())
};
},
"listeners": { "resize": {
"fn": function(panel) {
panel.items.each( function(item) { item.setHeight(500);return true } );
}
}
},
//.........这里部分代码省略.........
示例7: if
statusBar.showBusy();
}
else {
statusBar.setStatus("Done.");
}
if( success ) {
statusBar.setStatus({
text: '<?php
echo ext_Lang::msg('success', true);
?>
: ' + msg,
iconCls: 'success',
clear: true
});
Ext.msgBoxSlider.msg('<?php
echo ext_Lang::msg('success', true);
?>
', msg );
} else if( success != null ) {
statusBar.setStatus({
text: '<?php
echo ext_Lang::err('error', true);
?>
: ' + msg,
iconCls: 'error',
clear: true
});
}
示例8: execAction
function execAction($dir)
{
// make new directory or file
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('mkitem', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (extGetParam($_POST, 'confirm') == 'true') {
// CSRF Security Check
if (!ext_checkToken($GLOBALS['__POST']["token"])) {
ext_Result::sendResult('tokencheck', false, 'Request failed: Security Token not valid.');
}
$mkname = $GLOBALS['__POST']["mkname"];
$mktype = $GLOBALS['__POST']["mktype"];
$symlink_target = $GLOBALS['__POST']['symlink_target'];
$mkname = basename(stripslashes($mkname));
if ($mkname == "") {
ext_Result::sendResult('mkitem', false, $GLOBALS["error_msg"]["miscnoname"]);
}
$new = get_abs_item($dir, $mkname);
if (@$GLOBALS['ext_File']->file_exists($new)) {
ext_Result::sendResult('mkitem', false, $mkname . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
}
$err = print_r($_POST, true);
if ($mktype == "dir") {
$ok = @$GLOBALS['ext_File']->mkdir($new, 0777);
$err = $GLOBALS["error_msg"]["createdir"];
} elseif ($mktype == 'file') {
$ok = @$GLOBALS['ext_File']->mkfile($new);
$err = $GLOBALS["error_msg"]["createfile"];
} elseif ($mktype == 'symlink') {
if (empty($symlink_target)) {
ext_Result::sendResult('mkitem', false, 'Please provide a valid <strong>target</strong> for the symbolic link.');
}
if (!file_exists($symlink_target) || !is_readable($symlink_target)) {
ext_Result::sendResult('mkitem', false, 'The file you wanted to make a symbolic link to does not exist or is not accessible by PHP.');
}
$ok = symlink($symlink_target, $new);
$err = 'The symbolic link could not be created.';
}
if ($ok == false || PEAR::isError($ok)) {
if (PEAR::isError($ok)) {
$err .= $ok->getMessage();
}
ext_Result::sendResult('mkitem', false, $err);
}
ext_Result::sendResult('mkitem', true, 'The item ' . $new . ' was created');
return;
}
?>
{
"xtype": "form",
"id": "simpleform",
"labelWidth": 125,
"url":"<?php
echo basename($GLOBALS['script_name']);
?>
",
"dialogtitle": "Create New File/Directory",
"frame": true,
"items": [{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg("nameheader", true);
?>
",
"name": "mkname",
"width":175,
"allowBlank":false
},{
"xtype": "combo",
"fieldLabel": "Type",
"store": [["file", "<?php
echo ext_Lang::mime('file', true);
?>
"],
["dir", "<?php
echo ext_Lang::mime('dir', true);
?>
"]
<?php
if (!ext_isFTPMode() && !$GLOBALS['isWindows']) {
?>
,["symlink", "<?php
echo ext_Lang::mime('symlink', true);
?>
"]
<?php
}
?>
],
displayField:"type",
valueField: "mktype",
value: "file",
hiddenName: "mktype",
disableKeyFilter: true,
editable: false,
triggerAction: "all",
mode: "local",
allowBlank: false,
selectOnFocus:true
//.........这里部分代码省略.........
示例9: execAction
function execAction($dir)
{
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (!$GLOBALS["zip"] && !$GLOBALS["tgz"]) {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["miscnofunc"]);
}
$allowed_types = array('zip', 'tgz', 'tbz', 'tar');
// If we have something to archive, let's do it now
if (extGetParam($_POST, 'confirm') == 'true') {
$saveToDir = utf8_decode($GLOBALS['__POST']['saveToDir']);
if (!file_exists(get_abs_dir($saveToDir))) {
ext_Result::sendResult('archive', false, ext_Lang::err('archive_dir_notexists'));
}
if (!is_writable(get_abs_dir($saveToDir))) {
ext_Result::sendResult('archive', false, ext_Lang::err('archive_dir_unwritable'));
}
require_once _EXT_PATH . '/libraries/Archive/archive.php';
if (!in_array(strtolower($GLOBALS['__POST']["type"]), $allowed_types)) {
ext_Result::sendResult('archive', false, ext_Lang::err('extract_unknowntype') . ': ' . htmlspecialchars($GLOBALS['__POST']["type"]));
}
// This controls how many files are processed per Step (it's split up into steps to prevent time-outs)
$files_per_step = 2000;
$cnt = count($GLOBALS['__POST']["selitems"]);
$abs_dir = get_abs_dir($dir);
$name = basename(stripslashes($GLOBALS['__POST']["name"]));
if ($name == "") {
ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["miscnoname"]);
}
$startfrom = extGetParam($_REQUEST, 'startfrom', 0);
$dir_contents_cache_name = 'ext_' . md5(implode(null, $GLOBALS['__POST']["selitems"]));
$dir_contents_cache_file = _EXT_FTPTMP_PATH . '/' . $dir_contents_cache_name . '.txt';
$archive_name = get_abs_item($saveToDir, $name);
$fileinfo = pathinfo($archive_name);
if (empty($fileinfo['extension'])) {
$archive_name .= "." . $GLOBALS['__POST']["type"];
$fileinfo['extension'] = $GLOBALS['__POST']["type"];
foreach ($allowed_types as $ext) {
if ($GLOBALS['__POST']["type"] == $ext && @$fileinfo['extension'] != $ext) {
$archive_name .= "." . $ext;
}
}
}
if ($startfrom == 0) {
for ($i = 0; $i < $cnt; $i++) {
$selitem = stripslashes($GLOBALS['__POST']["selitems"][$i]);
if ($selitem == 'ext_root') {
$selitem = '';
}
if (is_dir(utf8_decode($abs_dir . "/" . $selitem))) {
$items = extReadDirectory(utf8_decode($abs_dir . "/" . $selitem), '.', true, true);
foreach ($items as $item) {
if (is_dir($item) || !is_readable($item) || $item == $archive_name) {
continue;
}
$v_list[] = str_replace('\\', '/', $item);
}
} else {
$v_list[] = utf8_decode(str_replace('\\', '/', $abs_dir . "/" . $selitem));
}
}
if (count($v_list) > $files_per_step) {
if (file_put_contents($dir_contents_cache_file, implode("\n", $v_list)) == false) {
ext_Result::sendResult('archive', false, 'Failed to create a temporary list of the directory contents');
}
}
} else {
$file_list_string = file_get_contents($dir_contents_cache_file);
if (empty($file_list_string)) {
ext_Result::sendResult('archive', false, 'Failed to retrieve the temporary list of the directory contents');
}
$v_list = explode("\n", $file_list_string);
}
$cnt_filelist = count($v_list);
// Now we go to the right range of files and "slice" the array
$v_list = array_slice($v_list, $startfrom, $files_per_step - 1);
$remove_path = $GLOBALS["home_dir"];
if ($dir) {
$remove_path .= $dir;
}
$debug = 'Starting from: ' . $startfrom . "\n";
$debug .= 'Files to process: ' . $cnt_filelist . "\n";
$debug .= implode("\n", $v_list);
//file_put_contents( 'log.txt', $debug, FILE_APPEND );
// Do some setup stuff
ini_set('memory_limit', '128M');
@set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);
$result = extArchive::create($archive_name, $v_list, $GLOBALS['__POST']["type"], '', $remove_path);
if (PEAR::isError($result)) {
ext_Result::sendResult('archive', false, $name . ': ' . ext_Lang::err('archive_creation_failed') . ' (' . $result->getMessage() . $archive_name . ')');
}
$json = new ext_Json();
if ($cnt_filelist > $startfrom + $files_per_step) {
$response = array('startfrom' => $startfrom + $files_per_step, 'totalitems' => $cnt_filelist, 'success' => true, 'action' => 'archive', 'message' => sprintf(ext_Lang::msg('processed_x_files'), $startfrom + $files_per_step, $cnt_filelist));
} else {
@unlink($dir_contents_cache_file);
if ($GLOBALS['__POST']["type"] == 'tgz' || $GLOBALS['__POST']["type"] == 'tbz') {
chmod($archive_name, 0644);
//.........这里部分代码省略.........
示例10: execAction
function execAction($dir)
{
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('upload', false, $GLOBALS["error_msg"]["accessfunc"]);
}
$this->_downloadMethods = array(new CurlDownloader(), new WgetDownloader(), new FopenDownloader(), new FsockopenDownloader());
//DEBUG ext_Result::sendResult('transfer', false, $dir );
// Execute
if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
$cnt = count($GLOBALS['__POST']['userfile']);
$err = false;
foreach ($this->_downloadMethods as $method) {
if ($method->isSupported()) {
$downloader =& $method;
break;
}
}
// upload files & check for errors
for ($i = 0; $i < $cnt; $i++) {
$errors[$i] = NULL;
$items[$i] = stripslashes(basename($GLOBALS['__POST']['userfile'][$i]));
$abs = get_abs_item($dir, $items[$i]);
if ($items[$i] == "") {
continue;
}
if (@file_exists($abs) && empty($_REQUEST['overwrite_files'])) {
$errors[$i] = $GLOBALS["error_msg"]["itemdoesexist"];
$err = true;
continue;
}
// Upload
$ok = $downloader->download($GLOBALS['__POST']['userfile'][$i], $abs);
if ($ok === true) {
$mode = ext_isFTPMode() ? 644 : 0644;
@$GLOBALS['ext_File']->chmod($abs, $mode);
} else {
$errors[$i] = $ok;
$err = true;
continue;
}
}
if ($err) {
// there were errors
$err_msg = "";
for ($i = 0; $i < $cnt; $i++) {
if ($errors[$i] == NULL) {
continue;
}
$err_msg .= $items[$i] . " : " . $errors[$i] . "\n";
}
ext_Result::sendResult('transfer', false, $err_msg);
}
ext_Result::sendResult('transfer', true, ext_Lang::msg('transfer_completed'));
return;
}
}
示例11: show_userform
function show_userform($data = null)
{
if ($data == null) {
$data = array('', '', '', '', '', '', '');
}
$formname = @$data[0] ? 'frmedituser' : 'frmadduser';
?>
{
"xtype": "form",
"id" : "<?php
echo $formname;
?>
",
"renderTo": Ext.getCmp("dialog_tabpanel").getEl(),
"hidden": true,
"closable":true,
"autoHeight": "true",
"labelWidth": 125,
"url":"<?php
echo basename($GLOBALS['script_name']);
?>
",
"title": "<?php
if (!empty($data[0])) {
printf($GLOBALS["messages"]["miscedituser"], $data[0]);
} else {
echo $GLOBALS["messages"]["miscadduser"];
}
?>
" ,
items: [{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('miscusername', true);
?>
",
"name": "nuser",
"value": "<?php
echo @$data[0];
?>
",
"width":175,
"allowBlank":false
},{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('miscconfpass', true);
?>
",
"name": "pass1",
"inputType": "password",
"width":175
},
{ "xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('miscconfnewpass', true);
?>
",
"name": "pass2",
"inputType": "password",
"width":175
},
<?php
if (!empty($data[0])) {
?>
{ "xtype": "checkbox",
"fieldLabel": "<?php
echo ext_Lang::msg('miscchpass', true);
?>
",
"name": "chpass",
"hiddenValue": "true"
},
<?php
}
?>
{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('mischomedir', true);
?>
",
"name": "home_dir",
"value": "<?php
echo !empty($data[2]) ? $data[2] : $_SERVER['DOCUMENT_ROOT'];
?>
",
"width":175,
"allowBlank":false
},
{ "xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('mischomeurl', true);
?>
",
"name": "home_url",
"value": "<?php
echo !empty($data[3]) ? $data[3] : $GLOBALS["home_url"];
?>
//.........这里部分代码省略.........
示例12: str_replace
echo str_replace("'", "\\'", $dir);
?>
' );
}
}
}
});
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime()+(1000*60*60*24*7)) //7 days from now
}));
<?php
if ($GLOBALS['require_login'] && $GLOBALS['mainframe']->getUserName() == 'admin' && ($GLOBALS['mainframe']->getPassword() == extEncodePassword('admin') || $GLOBALS['mainframe']->getPassword() == md5('admin'))) {
// Urge User to change admin password!
echo 'msgbox = Ext.Msg.alert(\'' . ext_Lang::msg('password_warning_title', true) . '\', \'' . ext_Lang::msg('password_warning_text', true) . '\',
function(btn) { if( btn == \'ok\' ) openActionDialog( null, \'admin\') }
);
msgbox.setIcon(Ext.MessageBox.WARNING);
';
}
?>
}
if( typeof Ext == 'undefined' ) {
document.location = '<?php
echo basename($GLOBALS['script_name']);
?>
?option=com_extplorer&nofetchscript=1';
}
示例13: onShowLoginForm
function onShowLoginForm()
{
?>
{
xtype: "form",
<?php
if (!ext_isXHR()) {
?>
renderTo: "adminForm", <?php
}
?>
id: "simpleform",
labelWidth: 125,
url:"<?php
echo basename($GLOBALS['script_name']);
?>
",
dialogtitle: "<?php
echo ext_Lang::msg('ftp_header');
?>
",
title: "<?php
echo ext_Lang::msg('ftp_login_lbl');
?>
",
frame: true,
keys: {
key: Ext.EventObject.ENTER,
fn : function(){
if (Ext.getCmp("simpleform").getForm().isValid()) {
Ext.get( 'statusBar').update( '<?php
echo ext_Lang::msg('ftp_login_check', true);
?>
' );
Ext.getCmp("simpleform").getForm().submit({
reset: false,
success: function(form, action) { location.reload() },
failure: function(form, action) {
if( !action.result ) return;
Ext.Msg.alert('<?php
echo ext_Lang::err('error', true);
?>
', action.result.error);
Ext.get( 'statusBar').update( action.result.error );
},
scope: Ext.getCmp("simpleform").getForm(),
params: {
option: "com_extplorer",
action: "login",
type: "ftp",
file_mode: "ftp"
}
});
} else {
return false;
}
}
},
items: [{
xtype: "textfield",
fieldLabel: "<?php
echo ext_Lang::msg('ftp_login_name', true);
?>
",
name: "username",
width:175,
allowBlank:false
},{
xtype: "textfield",
fieldLabel: "<?php
echo ext_Lang::msg('ftp_login_pass', true);
?>
",
name: "password",
inputType: "password",
width:175,
allowBlank:false
},{
xtype: "combo",
fieldLabel: "<?php
echo ext_Lang::msg('ftp_hostname_port', true);
?>
",
hiddenName: "ftp_host",
triggerAction: "all",
value: "<?php
echo extGetParam($_SESSION, 'ftp_host');
?>
",
store: ["<?php
echo implode('","', $GLOBALS['ext_conf']['remote_hosts_allowed']);
?>
"],
width:175,
editable: false,
forceSelection: true,
allowBlank:false
},
{
xtype: "displayfield",
//.........这里部分代码省略.........
示例14: execAction
function execAction($dir, $item)
{
// edit file
global $mainframe, $mosConfig_live_site;
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('edit', false, ext_Lang::err('accessfunc'));
}
$fname = get_abs_item($dir, $item);
if (!get_is_file(utf8_decode($fname))) {
ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('fileexist'));
}
if (!get_show_item($dir, $item)) {
ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('accessfile'));
}
if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
// Save / Save As
$item = basename(stripslashes($GLOBALS['__POST']["fname"]));
$fname2 = get_abs_item($dir, $item);
if (!isset($item) || $item == "") {
ext_Result::sendResult('edit', false, ext_Lang::err('miscnoname'));
}
if ($fname != $fname2 && @$GLOBALS['ext_File']->file_exists($fname2)) {
ext_Result::sendResult('edit', false, $item . ": " . ext_Lang::err('itemdoesexist'));
}
$this->savefile($fname2);
$fname = $fname2;
ext_Result::sendResult('edit', true, ext_Lang::msg('savefile') . ': ' . $item);
}
// header
$s_item = get_rel_item($dir, $item);
if (strlen($s_item) > 50) {
$s_item = "..." . substr($s_item, -47);
}
$s_info = pathinfo($s_item);
$s_extension = str_replace('.', '', $s_info['extension']);
switch (strtolower($s_extension)) {
case 'txt':
$cp_lang = 'text';
break;
case 'cs':
$cp_lang = 'csharp';
break;
case 'css':
$cp_lang = 'css';
break;
case 'html':
case 'htm':
case 'xml':
case 'xhtml':
$cp_lang = 'html';
break;
case 'java':
$cp_lang = 'java';
break;
case 'js':
$cp_lang = 'javascript';
break;
case 'pl':
$cp_lang = 'perl';
break;
case 'ruby':
$cp_lang = 'ruby';
break;
case 'sql':
$cp_lang = 'sql';
break;
case 'vb':
case 'vbs':
$cp_lang = 'vbscript';
break;
case 'php':
$cp_lang = 'php';
break;
default:
$cp_lang = 'generic';
}
?>
<div style="width:auto;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;"><?php
echo $GLOBALS["messages"]["actedit"] . ": /" . $s_item . ' ';
?>
</h3>
<div id="adminForm">
</div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
<?php
// Show File In TextArea
$content = $GLOBALS['ext_File']->file_get_contents($fname);
if (get_magic_quotes_runtime()) {
$content = stripslashes($content);
}
//$content = htmlspecialchars( $content );
//.........这里部分代码省略.........
示例15: execAction
function execAction($dir, $item)
{
// rename directory or file
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('rename', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
$newitemname = $GLOBALS['__POST']["newitemname"];
$newitemname = trim(basename(stripslashes($newitemname)));
if ($newitemname == '') {
ext_Result::sendResult('rename', false, $GLOBALS["error_msg"]["miscnoname"]);
}
if (!ext_isFTPMode()) {
$abs_old = get_abs_item($dir, $item);
$abs_new = get_abs_item($dir, $newitemname);
} else {
$abs_old = get_item_info($dir, $item);
$abs_new = get_item_info($dir, $newitemname);
}
if (@$GLOBALS['ext_File']->file_exists($abs_new)) {
ext_Result::sendResult('rename', false, ext_TextEncoding::toUTF8($newitemname) . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
}
$perms_old = $GLOBALS['ext_File']->fileperms($abs_old);
$ok = $GLOBALS['ext_File']->rename(get_abs_item($dir, $item), get_abs_item($dir, $newitemname));
if (ext_isFTPMode()) {
$abs_new = get_item_info($dir, $newitemname);
}
$GLOBALS['ext_File']->chmod($abs_new, $perms_old);
if ($ok === false || PEAR::isError($ok)) {
ext_Result::sendResult('rename', false, 'Could not rename ' . $dir . '/' . $item . ' to ' . $newitemname);
}
$msg = sprintf($GLOBALS['messages']['success_rename_file'], $item, $newitemname);
ext_Result::sendResult('rename', true, $msg);
}
$is_dir = get_is_dir(ext_isFTPMode() ? get_item_info($dir, $item) : get_abs_item($dir, $item));
?>
{
"xtype": "form",
"width": "350",
"height": "150",
"id": "simpleform",
"labelWidth": 125,
"url":"<?php
echo basename($GLOBALS['script_name']);
?>
",
"dialogtitle": "<?php
echo $GLOBALS['messages']['rename_file'];
?>
",
"frame": true,
"items": [{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('newname', true);
?>
",
"name": "newitemname",
"id": "newitemname",
"value": "<?php
echo str_replace("'", "\\'", stripslashes($item));
?>
",
"width":175,
"allowBlank":false
}
],
"listeners": { "afterrender": {
fn: function( form ) {
form.findById("newitemname").focus(true);
}
}
},
"buttons": [{
"text": "<?php
echo ext_Lang::msg('btnsave', true);
?>
",
"handler": function() {
statusBarMessage( 'Please wait...', true );
form = Ext.getCmp("simpleform").getForm();
form.submit({
//reset: true,
reset: false,
success: function(form, action) {
<?php
if ($is_dir) {
?>
if( dirTree.getSelectionModel().getSelectedNode() ) {
parentDir = dirTree.getSelectionModel().getSelectedNode().parentNode;parentDir.reload();parentDir.select();
}
<?php
}
?>
datastore.reload();
statusBarMessage( action.result.message, false, true );
Ext.getCmp("dialog").destroy();
},
failure: function(form, action) {
//.........这里部分代码省略.........