本文整理汇总了PHP中Listing::performSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP Listing::performSearch方法的具体用法?PHP Listing::performSearch怎么用?PHP Listing::performSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Listing
的用法示例。
在下文中一共展示了Listing::performSearch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
//.........这里部分代码省略.........
} else {
if ($this->replSpacesUpload || $fmReplSpaces) {
$newFile = str_replace(' ', '_', $newFile);
}
if ($this->lowerCaseUpload || $fmLowerCase) {
$newFile = strtolower($newFile);
}
if (!$this->Listing->upload($fmFile['tmp_name'][$i], $newFile)) {
$errors[] = $msg['errSave'] . ": {$newFile}";
} else {
if ($this->defaultFilePermissions) {
$Entry =& $this->Listing->getEntryByName($newFile);
if (!$Entry || !$Entry->changePerms($this->defaultFilePermissions)) {
$errors[] = $msg['errPermChange'] . ": {$newFile}";
}
}
}
}
} else {
if ($newFile != '') {
$errors[] = $msg['error'] . ": {$newFile} = 0 B";
$maxFileSize = ini_get('upload_max_filesize');
$postMaxSize = ini_get('post_max_size');
$info = "PHP settings: upload_max_filesize = {$maxFileSize}, ";
$info .= "post_max_size = {$postMaxSize}";
$error = "Could not upload {$newFile} ({$info})";
$this->Listing->FileSystem->addMsg($error, 'error');
}
}
}
}
$this->Listing->refresh();
if (count($errors) > 0) {
$this->error .= join('<br/>', $errors);
}
} else {
$this->Listing->view();
}
break;
case 'refresh':
$this->Listing->refresh();
break;
case 'permissions':
if ($this->enablePermissions && is_array($fmPerms) && $fmObject != '') {
if ($Entry =& $this->Listing->getEntry($fmObject)) {
$mode = '';
for ($i = 0; $i < 9; $i++) {
$mode .= $fmPerms[$i] ? 1 : 0;
}
if (!$Entry->changePerms(bindec($mode))) {
$this->error = $msg['errPermChange'] . ": {$Entry->name}";
}
}
}
if (!$this->error) {
$this->Listing->refresh();
}
break;
case 'edit':
if ($this->enableEdit && $fmObject != '') {
if ($Entry =& $this->Listing->getEntry($fmObject)) {
$fmText = $_POST['fmText'];
if ($fmText != '') {
if (!$Entry->saveFile($fmText)) {
$this->error = $msg['errSave'] . ": {$Entry->name}";
} else {
$this->Listing->refresh();
}
} else {
$Editor = new Editor($this);
$Editor->view($Entry);
}
}
}
break;
case 'search':
$this->Listing->performSearch($fmName);
break;
case 'switchView':
$this->Listing =& $this->Listing->switchView();
$this->Listing->refresh();
break;
default:
if (!$this->error) {
$this->Listing->view();
}
}
if ($this->ftpHost) {
$this->Listing->FileSystem->ftpClose();
}
$this->cleanUp();
$log = $this->Listing->FileSystem->getMessages();
}
if ($this->error != '') {
print '{{fmERROR}}' . $this->error . '{{/fmERROR}}';
$this->error = '';
}
print '{{fmLOG}}' . $log . '{{/fmLOG}}';
$this->save();
}