本文整理汇总了PHP中FileManager::GetPostedOrUploadedFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::GetPostedOrUploadedFile方法的具体用法?PHP FileManager::GetPostedOrUploadedFile怎么用?PHP FileManager::GetPostedOrUploadedFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::GetPostedOrUploadedFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
if (!empty($this->value['tmp_name']) && !empty($this->value['name'])) {
$result = basename(FileManager::GetPostedOrUploadedFile($this->_name, $this->_directory, 'jpg,jpeg,png,gif'));
if (!FileManager::Error()) {
$this->value = basename($result);
} else {
$this->error = 'Unable to upload ' . $this->label . ': ' . FileManager::Error();
}
} else {
$this->value = '';
}
}
示例2: ProcessPost
public static function ProcessPost(&$inserts, &$groups)
{
$content = array();
foreach ($inserts as $insert) {
$key = $insert['name'];
if ('image' == $insert['type']) {
$value = basename(FileManager::GetPostedOrUploadedFile($key, TYPEF_DIR . '/files/public/content'));
} elseif (isset($_POST[$key])) {
$value = $_POST[$key];
} else {
$value = null;
}
$content[$key] = $value;
}
foreach ($groups as $group) {
$key = $group['name'];
$content[$key] = isset($_POST[$key]) ? Content::RecurseGroups($group, $_POST[$key]) : null;
}
return $content;
}
示例3: trim
<?php
$article->setArray($_POST, false);
if (!empty($_POST['autosummary'])) {
$article['autosummary'] = 1;
$xml = Pagemill_SimpleXmlElement::LoadString($_POST['article']);
if ($xml->p) {
$summary = trim($xml->p[0]->innerXml());
} else {
$summary = trim(Bam_Functions::GetIntro($_POST['article']));
}
$article['summary'] = $summary;
} else {
$article['autosummary'] = 0;
}
$article['image'] = basename(FileManager::GetPostedOrUploadedFile('image', TYPEF_DIR . '/files/public/news', 'jpg,jpeg,png,gif'));
if (FileManager::Error()) {
$pm->addLoop('errors', array('message' => FileManager::Error()));
} else {
$article->save();
}
示例4: array
} else {
$skin = 'default';
}
} else {
$skin = 'default';
}
$groups = Insertable::GroupsFrom($full_template, $matches[1], $skin);
$group = $groups[0];
// @todo Check permissions here?
if ('POST' == $_SERVER['REQUEST_METHOD']) {
if (isset($_POST['action']) && 'Cancel' != $_POST['action']) {
$content = array();
foreach ($group['members'] as $member) {
$key = $member['name'];
if ('image' == $member['type']) {
$value = basename(FileManager::GetPostedOrUploadedFile($key, TYPEF_DIR . '/files/public/content'));
} elseif (isset($_POST[$key])) {
$value = $_POST[$key];
} else {
$value = null;
}
$content[$key] = $value;
}
$pm->setVariable('row', $content);
$pm->setVariable('group', $group);
}
Typeframe::SetPageTemplate('/admin/content/groups/form-post.html');
}
$pm->setVariable('action', $_SERVER['REQUEST_URI']);
$pm->setVariable('group', $group);
$pm->setVariable('template', $_REQUEST['template']);
示例5: basename
<?php
$category->setArray($_POST, false);
$image = FileManager::GetPostedOrUploadedFile('categoryimage', TYPEF_DIR . '/files/public/news');
$category['categoryimage'] = basename($image);
if (!$category->exists()) {
$ordered = new Model_News_Category();
$ordered->where('parentid = 0');
$ordered->order('sortnum DESC');
$last = $ordered->getFirst();
$category['sortnum'] = $last['sortnum'] + 1;
}
$category->save();