$file = $upfile->file(
'filter/'.$previewVersion,
- $this->data[$assocAlias],
- $i,
+ CorePlus::get_value($this->data, $assocAlias.'.'.$i),
array(
'model_name' => $model,
'mime_type' => 'original',
'nodata' => 'image',
)
);
- if (!empty($file)) {
+
echo $medium->embed(
$file,
array(
- 'alt' => $user['User']['name'],
+ 'alt' => CorePlus::get_value($user, 'User.name'),
'class' => 'shadow',
- 'restrict' => array('image')
+ 'id' => 'HomeUserImage',
+ 'restrict' => array('image')
)
);
- }
// ファイル情報出力
echo $upfile->fileInfo($file, $item);
$args = func_get_args();
// ファイル指定がない場合
- if (!isset($args[1]) || !isset($args[1][$args[2]])) {
- if (isset($args[3]['nodata']) && !empty($args[3]['nodata'])) {
+ if (empty($args[1])) {
+ if (isset($args[2]['nodata']) && !empty($args[2]['nodata'])) {
$data = array(
'id' => 0,
'model' => NULL,
'alternative' => '',
);
- if ($args[3]['nodata'] == 'image') {
+ if ($args[2]['nodata'] == 'image') {
$data['dirname'] = 'transfer/img';
$data['basename'] = 'noimage.png';
$data['alternative'] = 'No Image';
return NULL;
}
} else {
- $data = $args[1][$args[2]];
+ $data = $args[1];
}
// ファイルがある場合、ファイルパスを返す
// $pathがfilter/* 指定でファイルがない場合、作成
} elseif (substr($path, 0, 7) == 'filter/') {
require_once(APP.'plugins'.DS.'media'.DS.'libs'.DS.'upfile.php');
- $make_result = Upfile::make_version($path, $data['dirname']. DS. $data['basename'], $args[3]);
+ $make_result = Upfile::make_version($path, $data['dirname']. DS. $data['basename'], $args[2]);
// cacheを削除して$file読み込み
if ($make_result === true) {
parent::__destruct();
- return self::file($path, $args[1], $args[2], $args[3]);
+ return self::file($path, $args[1], $args[2]);
}
}
$file = $upfile->file(
'filter/m',
- $target_user['Attachment'],
- 0,
+ CorePlus::get_value($target_user, 'Attachment.0'),
array(
'model_name' => 'User',
'mime_type' => 'original',
$file,
array(
'url' => $url,
- 'alt' => $target_user['User']['name'],
+ 'alt' => CorePlus::get_value($user, 'User.name'),
'class' => 'shadow',
'id' => 'HomeUserImage',
'restrict' => array('image')
<?php
$file = $upfile->file(
'filter/xxs',
- $system['Attachment'],
- 0,
+ CorePlus::get_value($system, 'Attachment.0'),
array(
'model_name' => 'System',
'mime_type' => 'original',
$file = $upfile->file(
'filter/s',
- $system['Attachment'],
- 0,
+ CorePlus::get_value($system, 'Attachment.0'),
array(
'model_name' => 'System',
'mime_type' => 'original',
<?php
$file = $upfile->file(
'filter/xs',
- $system['Attachment'],
- 0,
+ CorePlus::get_value($system, 'Attachment.0'),
array(
'model_name' => 'System',
'mime_type' => 'original',
$file = $upfile->file(
'filter/s',
- $system['Attachment'],
- 0,
+ CorePlus::get_value($system, 'Attachment.0'),
array(
'model_name' => 'System',
'mime_type' => 'original',
$file,
array(
'linkTo' => $url,
- 'alt' => $system['Attachment'][0]['alternative'],
+ 'alt' => CorePlus::get_value($system, 'Attachment.0.alternative'),
'restrict' => array('image'),
'htmlAttributes' => array(
'target' => '_blank',
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Image'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php
- if (isset($target_user['Attachment'][0])) {
- $img_name = isset($target_user['Attachment'][0]['alternative']) ? $target_user['Attachment'][0]['alternative'] : $target_user['Attachment'][0]['basename'];
+ $file = $upfile->file(
+ 'filter/m',
+ CorePlus::get_value($target_user, 'Attachment.0'),
+ array(
+ 'model_name' => 'User',
+ 'mime_type' => 'original',
+ 'nodata' => 'image',
+ )
+ );
- echo $medium->embed($medium->file('filter/s', $target_user['Attachment'][0]));
-
- } else {
- echo " ";
- }
+ echo $medium->embed(
+ $file,
+ array(
+ 'alt' => CorePlus::get_value($user, 'User.name'),
+ 'class' => 'shadow',
+ 'id' => 'HomeUserImage',
+ 'restrict' => array('image')
+ )
+ );
?>
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>