<?php $DebateAnswerAttachments = DebateAnswerAttachment::getDebateAnswerAttachments($f_debate_nr, $f_debateanswer_nr); ?> <center> <TABLE width="95%" style="border: 1px solid #EEEEEE;"> <TR> <TD> <TABLE width="100%" bgcolor="#EEEEEE" cellpadding="3" cellspacing="0"> <TR> <TD align="left"> <STRONG><?php putGS("Files"); ?> </STRONG> </TD> <?php if (isset($f_edit_mode) && $f_edit_mode == "edit" && $g_user->hasPermission('AddFile')) { ?> <TD align="right"> <IMG src="<?php p($Campsite["ADMIN_IMAGE_BASE_URL"]); ?> /add.png" border="0"> <A href="javascript: void(0);" onclick="window.open('<?php echo camp_html_article_url($articleObj, $f_language_id, "files/popup.php"); ?> ', 'attach_file', 'scrollbars=yes, resizable=yes, menubar=no, toolbar=no, width=500, height=400, top=200, left=100');"><?php putGS("Attach"); ?> </A>
/** * Delete record from database. * * @return boolean */ function delete() { // delete correspondending Attachment object if not used by other DebateAnswers $DebateAnswerAttachments = DebateAnswerAttachment::getDebateAnswerAttachments(null, null, $this->getProperty('fk_attachment_id')); if (count($DebateAnswerAttachments) === 1) { $DebateAnswerAttachment = current($DebateAnswerAttachments); $DebateAnswerAttachment->getAttachment()->delete(); } // Delete record from the database $deleted = parent::delete(); /* if ($deleted) { if (function_exists("camp_load_translation_strings")) { camp_load_translation_strings("api"); } $logtext = getGS('Article #$1: "$2" ($3) deleted.', $this->m_data['Number'], $this->m_data['Name'], $this->getLanguageName()) ." (".getGS("Publication")." ".$this->m_data['IdPublication'].", " ." ".getGS("Issue")." ".$this->m_data['NrIssue'].", " ." ".getGS("Section")." ".$this->m_data['NrSection'].")"; Log::Message($logtext, null, 32); } */ $CampCache = CampCache::singleton(); $CampCache->clear('user'); return $deleted; }
function getDebateAnswerAttachments() { $DebateAnswerAttachments = DebateAnswerAttachment::getDebateAnswerAttachments($this->getDebateNumber(), $this->getNumber()); return $DebateAnswerAttachments; }