attachment; $params = $this->params; // Get the parent id and a few other convenience items $parent_id = $attachment->parent_id; if ( $parent_id === null ) { $parent_id = 0; } // Set up to toggle between uploading file/urls if ( $attachment->uri_type == 'file' ) { $upload_toggle_button_text = JText::_('ATTACH_ENTER_URL_INSTEAD'); $upload_toggle_url = $this->upload_url_url; $upload_button_text = JText::_('ATTACH_UPLOAD_VERB'); } else { $upload_toggle_button_text = JText::_('ATTACH_SELECT_FILE_TO_UPLOAD_INSTEAD'); $upload_toggle_url = $this->upload_file_url; $upload_button_text = JText::_('ATTACH_ADD_URL'); } // If this is for an existing content item, modify the URL appropriately if ( $this->new_parent ) { $upload_toggle_url .= "&parent_id=0,new"; } if ( JRequest::getWord('editor') ) { $upload_toggle_url .= "&editor=" . JRequest::getWord('editor'); } // Needed URLs $save_url = JRoute::_($this->save_url); $base_url = $uri->root(true) . '/'; // Prepare for error displays $upload_id = 'upload'; switch ( $this->error ) { case 'no_file': $upload_id = 'upload_warning'; break; case 'file_too_big': $upload_id = 'upload_warning'; break; case 'file_already_on_server': $upload_id = 'upload_warning'; break; } // If this is an error re-display, display the CSS links directly if ( $this->error ) { echo $this->startHTML(); } // Display the form ?>