* @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 */ if(!defined('CON_FRAMEWORK')) { die('Illegal call'); } if (!isset($_REQUEST["elemperpage"]) || !is_numeric($_REQUEST['elemperpage']) || $_REQUEST['elemperpage'] < 0) { $oUser = new cApiUser($auth->auth["uid"]); $_REQUEST["elemperpage"] = $oUser->getProperty("itemsperpage", $area); unset($oUser); } $tpl->reset(); ################# # New Module Link ################# $str = ''; if ((int) $client > 0) { ####### # Sync Module ####### $oModuleCollection = new cApiModuleCollection; $oModuleCollection->setWhere("idclient", $client); $oModuleCollection->query(); $iItemCount = $oModuleCollection->count(); // sync all modules if wanted if(isset($_GET['syncmod']) && (int) $_GET['syncmod'] == 1) { /* @var $oModule cApiModule */ while ($oModule = $oModuleCollection->next()) { if(!$oModule->isLoadedFromFile('output') && !$oModule->isLoadedFromFile('input')) continue; if($oModule->isLoadedFromFile('output')) { $oModule->set("output", addslashes(stripslashes($oModule->get('output')))); } if($oModule->isLoadedFromFile('input')) { $oModule->set("input", addslashes(stripslashes($oModule->get('input')))); } $oModule->set("lastmodified", date("Y-m-d H:i:s")); $oModule->store(); unset($oModule); } } unset($oModuleCollection); $str = '
'; $str .= ''.i18n("New module").''."\n"; if($cfg['dceModEdit']['use'] == true && $iItemCount > 0) { $str .= ''."\n"; $str .= i18n("Sync module").''; } $str .= '
'; } else { $str = '
'.i18n('No Client selected').'
'; } #only show other options, if there is a active client if ((int) $client > 0) { $_REQUEST['page'] = (isset($_REQUEST['page']))?(int)$_REQUEST['page']:1; ############### # List Options ############### $aSortByOptions = array ("name" => i18n("Name"), "type" => i18n("Type")); $aSortOrderOptions = array ("asc" => i18n("Ascending"), "desc" => i18n("Descending")); $_REQUEST['sortby'] = (isset($_REQUEST['sortby']) && array_key_exists($_REQUEST['sortby'], $aSortByOptions))? $_REQUEST['sortby']:''; $_REQUEST['sortorder'] = (isset($_REQUEST['sortorder']) && array_key_exists($_REQUEST['sortorder'], $aSortOrderOptions))? $_REQUEST['sortorder']:''; $listoplink="listoptions"; $oListOptionRow = new cFoldingRow("e9ddf415-4b2d-4a75-8060-c3cd88b6ff98", i18n("List options"), $listoplink); $tpl->set('s', 'LISTOPLINK', $listoplink); $oSelectItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelectItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelectItemsPerPage->setDefault($_REQUEST["elemperpage"]); $oSelectSortBy = new cHTMLSelectElement("sortby"); $oSelectSortBy->autoFill($aSortByOptions); $oSelectSortBy->setDefault($_REQUEST["sortby"]); $oSelectSortOrder = new cHTMLSelectElement("sortorder"); $oSelectSortOrder->autoFill($aSortOrderOptions); $oSelectSortOrder->setDefault($_REQUEST["sortorder"]); $oSelectSearchIn = new cHTMLSelectElement("searchin"); $oSelectSearchIn->autoFill(array('' => i18n("-- All --"), 'name' => i18n("Modulname"), 'description' => i18n("Description"), 'type' => i18n("Type"), 'input' => i18n("Input"), 'output' => i18n("Output"))); if(isset($_REQUEST["searchin"])) $oSelectSearchIn->setDefault($_REQUEST["searchin"]); // build list with filter types $sql = "SELECT type FROM ".$cfg["tab"]["mod"]." WHERE idclient = '".Contenido_Security::toInteger($client)."' GROUP BY type"; $db->query($sql); $aFilterType = array(); $aFilterType["--all--"] = i18n("-- All --"); $aFilterType["--wotype--"] = i18n("-- Without type --"); while ($db->next_record()) { if (trim($db->f("type")) != "") { $aFilterType[$db->f("type")] = $db->f("type"); } } $oSelectTypeFilter = new cHTMLSelectElement("filtertype"); $oSelectTypeFilter->autoFill($aFilterType); if(isset($_REQUEST["filtertype"])) $oSelectTypeFilter->setDefault($_REQUEST["filtertype"]); $_REQUEST["filter"] = (isset($_REQUEST["filter"]))?$_REQUEST["filter"]:''; $oTextboxFilter = new cHTMLTextbox("filter", stripslashes($_REQUEST["filter"]), 15); $content = '
'; // Ye stuff will be done in javascript on apply button $content .= '
'; $content .= ''; $content .= ''; $content .= ''; //$content .= ''; if(isset($_REQUEST["page"])) $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= '
'.i18n("Items / page").''.$oSelectItemsPerPage->render().'
'.i18n("Sort by").''.$oSelectSortBy->render().'
'.i18n("Sort order").''.$oSelectSortOrder->render().'
'.i18n("Type filter").''.$oSelectTypeFilter->render().'
'.i18n("Search for").''.$oTextboxFilter->render().'
'.i18n("Search in").''.$oSelectSearchIn->render().'
 
'; $content .= '
'; $content .= '
'; $oListOptionRow->setContentData($content); ####### # Pager ####### $oPagerLink = new cHTMLLink; $pagerl="pagerlink"; $oPagerLink->setTargetFrame('left_bottom'); $oPagerLink->setLink("main.php"); $oPagerLink->setCustom("elemperpage", $_REQUEST["elemperpage"]); $oPagerLink->setCustom("filter", stripslashes($_REQUEST["filter"])); $oPagerLink->setCustom("sortby", $_REQUEST["sortby"]); $oPagerLink->setCustom("sortorder", $_REQUEST["sortorder"]); $oPagerLink->setCustom("frame", 2); $oPagerLink->setCustom("area", $area); $oPagerLink->enableAutomaticParameterAppend(); $oPagerLink->setCustom("contenido", $sess->id); $oPager = new cObjectPager("02420d6b-a77e-4a97-9395-7f6be480f497", $iItemCount, $_REQUEST["elemperpage"], $_REQUEST["page"], $oPagerLink, "page", $pagerl); $tpl->set('s', 'PAGINGLINK', $pagerl); $tpl->set('s', 'ACTION', $str.''.$oListOptionRow->render().$oPager ->render().'
'); } else { $tpl->set('s', 'PAGINGLINK', ''); $tpl->set('s', 'ACTION', $str); $tpl->set('s', 'LISTOPLINK', ''); } ############################ # generate template ############################ $tpl->generate($cfg['path']['templates'] . $cfg['templates']['mod_left_top']); ?>