attachment; $params = $this->params; $update = $this->update; $parent_id = $attachment->parent_id; if ( $parent_id === null ) { $parent_id = 0; } // set up URL redisplay in case of errors $old_url = ''; if ( $this->error_msg && ($update == 'url') ) { $old_url = $attachment->url; } // Decide what type of update to do if ( $update == 'file' ) { $enctype = "enctype=\"multipart/form-data\""; } else { $enctype = ''; } // Prepare for error displays $update_id = 'upload'; $filename = $attachment->filename; if ( $this->error ) { switch ( $this->error ) { case 'no_file': $update_id = 'upload_warning'; $filename = ''; break; case 'file_too_big': $upload_id = 'upload_warning'; break; case 'file_already_on_server': $upload_id = 'upload_warning'; break; } } // Format modified date jimport( 'joomla.utilities.date' ); $tz = new DateTimeZone( $user->getParam('timezone', $app->getCfg('offset')) ); $mdate = JFactory::getDate($attachment->modified); $mdate->setTimezone($tz); $date_format = $params->get('date_format', 'Y-m-d H:i'); $last_modified = $mdate->format($date_format, true); // If this is an error re-display, display the CSS links directly $echo_css = $this->error; /** Load the Attachments helper */ require_once(JPATH_SITE.'/components/com_attachments/helper.php'); require_once(JPATH_SITE.'/components/com_attachments/javascript.php'); // Add the stylesheets $uri = JFactory::getURI(); AttachmentsJavascript::setupJavascript(); if ( $attachment->uri_type == 'file' ) { $header_msg = JText::sprintf('ATTACH_UPDATE_ATTACHMENT_FILE_S', $filename); } else { $header_msg = JText::sprintf('ATTACH_UPDATE_ATTACHMENT_URL_S', $attachment->url); } // If this is an error re-display, display the CSS links directly if ( $this->error ) { echo $this->startHTML(); } ?>