$form .= $listbox_system.'
</td>
</tr>
<tr>
<td width="140" valign="top">'._JLIST_FRONTEND_UPLOAD_FILENAME.'
</td>
<td width="200">
<input name="file_upload" size="38" type="file" value="'.$file_upload.'"> '.$image1.$file_upload_pic.$image2.'<br />'._JLIST_FRONTEND_UPLOAD_ALLOWED_FILETYPE.': <b>'.$jlistConfig['allowed.upload.file.types'].'</b><br />'._JLIST_FRONTEND_UPLOAD_ALLOWED_MAX_SIZE.': <b>'.$jlistConfig['allowed.upload.file.size'].' KB</b>
</td>
</tr>
<tr>
<td width="140" valign="top">'._JLIST_FRONTEND_UPLOAD_PIC_FILETITLE.'
</td>
<td width="200">
<input name="pic_upload" size="38" type="file" value="'.$pic_upload.'"><br />'._JLIST_FRONTEND_UPLOAD_PIC_ALLOWED_FILES.' <b>.gif .jpg .png </b>
</td>
</tr>
<tr>
<td width="140" valign="top">'._JLIST_FRONTEND_UPLOAD_TITEL_DESC_FILE.'
</td>
<td width="267">
<textarea name="description" rows="2" cols="35">'.$description.'</textarea> '.$image1.$description_pic.$image2.'
</td>
</tr>
<tr>
<td width="140" valign="top">'._JLIST_FRONTEND_UPLOAD_TITEL_DESC_FILE_LONG.'
</td>
<td width="267">
<?php
$editor =& JFactory::getEditor();
echo $editor->display("description_long", $description_long, "100%", "400", "70", "15");
?>
</td>
</tr>
<tr>
<td width="140" valign="middle">
</td>
<td width="267">
<input type="submit" name="senden" value="'._JLIST_FRONTEND_UPLOAD_FILENAME_BUTTON_TEXT_SEND.'"> <input type="reset" name="cancel" value="'._JLIST_FRONTEND_UPLOAD_FILENAME_BUTTON_TEXT_CLEAR.'">
</td>
</tr>
</table>
<input type="hidden" name="option" value="'.$option.'" />
<input type="hidden" name="task" value="'.$task.'" />
<input type="hidden" name="send" value="1" /></form>
<input type="hidden" name="MAX_FILE_SIZE" value="'.$max_file_size.'">';
} else {
$form = '';
} // end access if()...
$html_form = str_replace('{form}', $form, $html_form);
if (isset($msg)) {
$html_form = str_replace('{msg}', $msg, $html_form);
}
echo $html_form;
echo $footer;
// Focus auf erstes feld setzen
if ($access) {
if ($my->id > 0) {
?>
<script type="text/Javascript" language="JavaScript">
<!--
document.getElementById("author").focus();
-->
</script>
<?php
} else {
?>
<script type="text/Javascript" language="JavaScript">
<!--
document.getElementById("name").focus();
-->
</script>
<?php
}
}
}
function showSearchForm($option){
global $Itemid, $jlistConfig, $my, $mainframe;
$mainframe->setPageTitle( $jlistConfig['jd.header.title'].' - '._JLIST_FRONTEND_SEARCH_LINKTEXT );
$html_form = makeHeader($html_form, false, false, false, 0, false, true, false, false, false, 0, 0, 0, 0, 0);
echo $html_form;
$html_form = '';
$html_form = '<form name="jdsearch" action="index.php?option=com_jdownloads&Itemid='.$Itemid.'&task=search.result" method="post">';
$html_form .= '<table class="jd_div_content" border="0" cellpadding="0" cellspacing="5" width="99%">
<tr><td><br /></td></tr>
<tr>
<td width="100" valign="middle">'._JLIST_FRONTEND_SEARCH_TEXT_TITLE.'
</td>
<td width="200" valign="middle">
<input class="jd_inputbox" type="text" name="jdsearchtext" id="jdsearchtext" maxlength="80" size="30" value=""> <input type="submit" name="searchsubmit" value="'._JLIST_FRONTEND_SEARCH_BUTTON_TEXT.'"/>
</td>
</tr>
<tr>
<td width="100" valign="middle">'._JLIST_FRONTEND_SEARCH_IN_TITLE.'
</td>
<td width="200">
<input class="jd_inputbox" type="checkbox" name="jdsearchintitle" id="jdsearchintitle" value="1" checked="checked">
</td>
</tr>
<tr>
<td width="100" valign="middle">'._JLIST_FRONTEND_SEARCH_IN_DESC.'
</td>
<td width="200">
<input class="jd_inputbox" type="checkbox" name="jdsearchindesc" id="jdsearchindesc" value="1" checked="checked">
</td>
</tr>
<tr>
<td width="100" valign="middle">'._JLIST_FRONTEND_SEARCH_NUMBERS.'
</td>
<td width="200">
<input class="jd_inputbox" type="text" name="jdsearchnumber" id="jdsearchnumber" maxlength="3" size="3" value="30">
</td>
</tr>
<tr><td><br /><br /></td></tr>
</table>
</form>';
$html_form .= makeFooter(true, false, false, 0, 0, 0, 0);
if ( !$jlistConfig['offline'] ) {
echo $html_cat;
} else {
if ($my->gid == 2) {
echo _JLIST_BACKEND_OFFLINE_ADMIN_MESSAGE_TEXT;
echo $html_cat;
} else {
$html_off = '<br /><br />'.$jlistConfig['offline.text'].'<br /><br />';
echo $html_off;
}
}
echo $html_form;
?>
<script type="text/Javascript" language="JavaScript">
<!--
document.getElementById("jdsearchtext").focus();
-->
</script>
<?php
}
function showSearchResult($option){
global $database, $Itemid, $mosConfig_absolute_path, $jlistConfig, $mainframe;
$mainframe->setPageTitle( $jlistConfig['jd.header.title'].' - '._JLIST_FRONTEND_SEARCH_RESULT_TITLE );
$html_form = makeHeader($html_form, false, false, false, 0, false, true, false, false, false, 0, 0, 0, 0, 0);
$searchtext = $database->getEscaped(mosGetParam($_POST, 'jdsearchtext', ''));
$searchintitle = $database->getEscaped(mosGetParam($_POST, 'jdsearchintitle', ''));
$searchintext = $database->getEscaped(mosGetParam($_POST, 'jdsearchindesc', ''));
$searchnumber = intval($database->getEscaped(mosGetParam($_POST, 'jdsearchnumber', 30)));
if (!$searchnumber) $searchnumber = 30;
if (strlen($searchtext) < 3){
echo "<script> alert('"._JLIST_FRONTEND_SEARCH_RESULT_TEXT_TO_SHORT."'); window.history.go(-1); </script>\n";
}
if (!$searchintitle && !$searchintext){
echo "<script> alert('"._JLIST_FRONTEND_SEARCH_RESULT_NO_OPTION."'); window.history.go(-1); </script>\n";
}
if ($searchintitle && $searchintext){
$database->setQuery("SELECT * FROM #__jdownloads_files WHERE file_title LIKE '%$searchtext%' OR description LIKE '%$searchtext%' OR description_long LIKE '%$searchtext%' AND published = 1 ORDER BY date_added LIMIT $searchnumber");
}
if ($searchintitle && !$searchintext){
$database->setQuery("SELECT * FROM #__jdownloads_files WHERE file_title LIKE '%$searchtext%' AND published = 1 ORDER BY date_added LIMIT $searchnumber");
}
if (!$searchintitle && $searchintext){
$database->setQuery("SELECT * FROM #__jdownloads_files WHERE description LIKE '%$searchtext%' OR description_long LIKE '%$searchtext%' AND published = 1 ORDER BY date_added LIMIT $searchnumber");
}
$files = $database->loadObjectList();
if ($files) {
// files gefunden
// cat der files holen und auf access beschrдnken
$access = checkAccess_JD();
$output = array();
foreach($files as $file) {
if ($file->published) {
$database->setQuery("SELECT * FROM #__jdownloads_cats WHERE cat_id = '$file->cat_id'");
$cat = $database->loadObjectList();
if ($cat[0]->cat_access <= $access){
$output[] = $file;
}
}
}
if ($output) {
$files_found = true;
// result header
$html_form .= '<table class="jd_search_form" border="0" cellpadding="0" cellspacing="5" width="99%">
<tr>
<td class="jd_search_result_title" width="100%"><b>'._JLIST_FRONTEND_SEARCH_RESULT_TITLE.'</b><br />'
._JLIST_FRONTEND_SEARCH_RESULT_SEARCH_TEXT.': <b>'.$searchtext.'</b><br />'
._JLIST_FRONTEND_SEARCH_RESULT_SUM_FILES.': <b>'.count($output).'</b></td>
</tr>
<tr>
</tr>';
foreach ($output as $out){
// suchtext farblich hervorheben
if ($searchintitle && $searchintext){
$out->description = eregi_replace($searchtext, '<font color="#CC3300">'.$searchtext.'</font>', $out->description);
$out->file_title = eregi_replace($searchtext, '<font color="#CC3300">'.$searchtext.'</font>', $out->file_title);
}
if ($searchintitle && !$searchintext){
$out->file_title = eregi_replace($searchtext, '<font color="#CC3300">'.$searchtext.'</font>', $out->file_title);
}
if (!$searchintitle && $searchintext){
$out->description = eregi_replace($searchtext, '<font color="#CC3300">'.$searchtext.'</font>', $out->description);
}
$titel_link = sefRelToAbs('index.php?option='.$option.'&Itemid='.$Itemid.'&task=view.download&cid='.$out->file_id);
$titel_link_text = '<a href="'.$titel_link.'">'.$out->file_title.'</a>';
$detail_link_text = '<a href="'.$titel_link.'">'._JLIST_FE_DETAILS_LINK_TEXT_TO_DETAILS.'</a>';
$html_form .= '<tr width="100%"><td class="jd_search_results"><b>'.$titel_link_text.' '.$out->release.'</b><br />'.substr($out->description, 0, 400).'...<br />'.$detail_link_text.'</td></tr>';
}
$html_form .= '</table>';
} else {
$files_found = false;
}
} else {
$files_found = false;
}
if (!$files_found) {
// keine files gefunden - oder falsche berechtigung
// result header
$html_form .= '<table class="jd_search_form" border="0" cellpadding="0" cellspacing="5" width="99%">
<tr>
<td class="jd_search_result_title" width="100%"><b>'._JLIST_FRONTEND_SEARCH_RESULT_TITLE.'</b><br />'
._JLIST_FRONTEND_SEARCH_RESULT_SEARCH_TEXT.': <b>'.$searchtext.'</b><br />'
._JLIST_FRONTEND_SEARCH_RESULT_NO_SUM_FILES.'</td>
</tr>
<tr>
</tr></table>';
}
$html_form .= makeFooter(true, false, false, 0, 0, 0, 0);
echo $html_form;
}
//end of class
}