* @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org * @since file available since contenido release <= 4.6 * * {@internal * @created 2003-03-26 * @modified 2008-06-27, Frederic Schneider, add security fix * @modified 2008-09-08, Ingo van Peeren, improved navigation tree in left bottom frame, expanding/ * collapsing of navigation tree without reloading (AJAX/ * javascript solution based on jquery) * @modified 2008-09-18, Ingo van Peeren, moved template-changing to jquery * @modified 2010-06-16, Timo Trautmann, Fixed a bug wit the Syncselection (there was no right userright check) * * $Id$: * }} * */ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } cInclude("includes", "functions.str.php"); cInclude("includes", "functions.tpl.php"); cInclude('includes', 'functions.lang.php'); if (!isset($oTpl) || !is_object($oTpl)) { $oTpl = new Template(); } $oTpl->reset(); global $sess, $frame, $area; $idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1; //Get sync options if (isset($syncoptions)) { $syncfrom = (int) $syncoptions; $remakeCatTable = true; } if (!isset($syncfrom)) { $syncfrom = -1; } $syncoptions = $syncfrom; $oTpl->set('s', 'SYNC_LANG', $syncfrom); ########################################## # Delete a saved search ########################################## $bShowArticleSearch = false; if (isset($_GET['delsavedsearch'])) { if (isset($_GET['itemtype']) && sizeof($_GET['itemtype']) > 0 && isset($_GET['itemid']) && sizeof($_GET['itemid']) > 0) { $propertyCollection = new PropertyCollection; $propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']); $bShowArticleSearch = true; } } if (isset($_GET['save_search']) && $_GET['save_search'] == 'true') { $bShowArticleSearch = true; } ########################################## # ARTICLE SEARCH ########################################## # modified 20/04/2007 by H. Librenz for backend search $arrDays = array(); for ($i = 0; $i < 32; $i++) { if ($i == 0) { $arrDays[$i] = '--'; } else { $arrDays[$i] = $i; } } $arrMonths = array(); for ($i = 0; $i < 13; $i++) { if ($i == 0) { $arrMonths[$i] = '--'; } else { $arrMonths[$i] = $i; } } $arrYears = array(); $arrYears[0] = '-----'; $sActualYear = (int) date("Y"); for ($i = $sActualYear - 10; $i < $sActualYear + 30; $i++) { $arrYears[$i] = $i; } $arrUsers = array(); $query = "SELECT * FROM " . $cfg['tab']['phplib_auth_user_md5'] . " ORDER BY realname"; $arrUsers['n/a'] = '-'; $db->query($query); while ($db->next_record()) { $arrUsers[$db->f('username')] = $db->f('realname'); } $arrDateTypes = array(); $arrDateTypes['n/a'] = i18n('Ignore'); $arrDateTypes['created'] = i18n('Date created'); $arrDateTypes['lastmodified'] = i18n('Date modified'); $arrDateTypes['published'] = i18n('Date published'); $articleLink = "editarticle"; $oListOptionRow = new cFoldingRow("3498dbba-ed4a-4618-8e49-3a3635396e22", i18n("Article Search"), $articleLink, $bShowArticleSearch); $oTpl->set('s', 'ARTICLELINK', $articleLink); #Textfeld $oTextboxArtTitle = new cHTMLTextbox("bs_search_text", (isset($_REQUEST["bs_search_text"]) ? $_REQUEST["bs_search_text"] : ''), 10); $oTextboxArtTitle->setStyle('width:135px;'); #Artikel_ID-Feld $oTextboxArtID = new cHTMLTextbox("bs_search_id", (isset($_REQUEST["bs_search_id"]) ? $_REQUEST["bs_search_id"] : ''), 10); $oTextboxArtID->setStyle('width:135px;'); #Date type $oSelectArtDateType = new cHTMLSelectElement("bs_search_date_type", "bs_search_date_type"); $oSelectArtDateType->autoFill($arrDateTypes); $oSelectArtDateType->setStyle('width:135px;'); $oSelectArtDateType->setEvent("Change", "toggle_tr_visibility('tr_date_from');toggle_tr_visibility('tr_date_to');"); if (isset($_REQUEST["bs_search_date_type"]) && $_REQUEST["bs_search_date_type"] != '') { $oSelectArtDateType->setDefault($_REQUEST["bs_search_date_type"]); } else { $oSelectArtDateType->setDefault('n/a'); } #DateFrom $oSelectArtDateFromDay = new cHTMLSelectElement("bs_search_date_from_day"); $oSelectArtDateFromDay->setStyle('width:40px;'); $oSelectArtDateFromDay->autoFill($arrDays); $oSelectArtDateFromMonth = new cHTMLSelectElement("bs_search_date_from_month"); $oSelectArtDateFromMonth->setStyle('width:40px;'); $oSelectArtDateFromMonth->autoFill($arrMonths); $oSelectArtDateFromYear = new cHTMLSelectElement("bs_search_date_from_year"); $oSelectArtDateFromYear->setStyle('width:55px;'); $oSelectArtDateFromYear->autoFill($arrYears); if (isset($_REQUEST["bs_search_date_from_day"]) && $_REQUEST["bs_search_date_from_day"] > 0) { $oSelectArtDateFromDay->setDefault($_REQUEST["bs_search_date_from_day"]); } else { $oSelectArtDateFromDay->setDefault(0); } if (isset($_REQUEST["bs_search_date_from_month"]) && $_REQUEST["bs_search_date_from_month"] > 0) { $oSelectArtDateFromMonth->setDefault($_REQUEST["bs_search_date_from_month"]); } else { $oSelectArtDateFromMonth->setDefault(0); } if (isset($_REQUEST["bs_search_date_from_year"]) && $_REQUEST["bs_search_date_from_year"] > 0) { $oSelectArtDateFromYear->setDefault($_REQUEST["bs_search_date_from_year"]); } else { $oSelectArtDateFromYear->setDefault(0); } #DateTo $oSelectArtDateToDay = new cHTMLSelectElement("bs_search_date_to_day"); $oSelectArtDateToDay->setStyle('width:40px;'); $oSelectArtDateToDay->autoFill($arrDays); $oSelectArtDateToMonth = new cHTMLSelectElement("bs_search_date_to_month"); $oSelectArtDateToMonth->setStyle('width:40px;'); $oSelectArtDateToMonth->autoFill($arrMonths); $oSelectArtDateToYear = new cHTMLSelectElement("bs_search_date_to_year"); $oSelectArtDateToYear->setStyle('width:55px;'); $oSelectArtDateToYear->autoFill($arrYears); if (isset($_REQUEST["bs_search_date_to_day"]) && $_REQUEST["bs_search_date_to_day"] > 0) { $oSelectArtDateToDay->setDefault($_REQUEST["bs_search_date_to_day"]); } else { $oSelectArtDateToDay->setDefault(0); } if (isset($_REQUEST["bs_search_date_to_month"]) && $_REQUEST["bs_search_date_to_month"] > 0) { $oSelectArtDateToMonth->setDefault($_REQUEST["bs_search_date_to_month"]); } else { $oSelectArtDateToMonth->setDefault(0); } if (isset($_REQUEST["bs_search_date_to_year"]) && $_REQUEST["bs_search_date_to_year"] > 0) { $oSelectArtDateToYear->setDefault($_REQUEST["bs_search_date_to_year"]); } else { $oSelectArtDateToYear->setDefault(0); } #Author $oSelectArtAuthor = new cHTMLSelectElement("bs_search_author"); $oSelectArtAuthor->setStyle('width:135px;'); $oSelectArtAuthor->autoFill($arrUsers); if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] != '') { $oSelectArtAuthor->setDefault($_REQUEST["bs_search_author"]); } else { $oSelectArtAuthor->setDefault('n/a'); } $oSubmit = new cHTMLButton("submit", i18n("Search")); $content = '
' . $form->render() . ' |
' . $sSyncButton . $sSyncButtonMultiple . ' |