protected function _saveDefaultImage($deleteIcon = false) { $image_filepath = 'files/attach/xeicon/'; $site_info = Context::get('site_module_info'); if ($site_info->site_srl) { $image_filepath .= $site_info->site_srl . '/'; } if ($deleteIcon) { $info = Rhymix\Framework\Storage::readPHPData($image_filepath . 'default_image.php'); if ($info['filename']) { Rhymix\Framework\Storage::delete(\RX_BASEDIR . $info['filename']); } Rhymix\Framework\Storage::delete($image_filepath . 'default_image.php'); return; } $tmpicon_filepath = \RX_BASEDIR . $image_filepath . 'tmp/default_image.png'; if (file_exists($tmpicon_filepath)) { list($width, $height, $type) = @getimagesize($tmpicon_filepath); switch ($type) { case 'image/gif': $target_filename = $image_filepath . 'default_image.gif'; break; case 'image/jpeg': $target_filename = $image_filepath . 'default_image.jpg'; break; case 'image/png': default: $target_filename = $image_filepath . 'default_image.png'; } Rhymix\Framework\Storage::move($tmpicon_filepath, \RX_BASEDIR . $target_filename); Rhymix\Framework\Storage::writePHPData(\RX_BASEDIR . 'files/attach/xeicon/' . $virtual_site . 'default_image.php', array('filename' => $target_filename, 'width' => $width, 'height' => $height)); } }
function getSiteDefaultImageUrl(&$width = 0, &$height = 0) { $site_info = Context::get('site_module_info'); if ($site_info->site_srl) { $virtual_site = $site_info->site_srl . '/'; } else { $virtual_site = ''; } $info = Rhymix\Framework\Storage::readPHPData(\RX_BASEDIR . 'files/attach/xeicon/' . $virtual_site . 'default_image.php'); if ($info && Rhymix\Framework\Storage::exists(\RX_BASEDIR . $info['filename'])) { $width = $info['width']; $height = $info['height']; return \RX_BASEURL . $info['filename'] . '?' . date('YmdHis', filemtime(\RX_BASEDIR . $info['filename'])); } else { return false; } }