Inheritance: extends BaseList
Exemplo n.º 1
0
?>
" class="save-button-small" onclick="popup_save();"
	id="context_button_save"></div>
<h2><?php 
echo putGS('Related Articles');
?>
</h2>
</div>
<div class="context-content" style="position:relative">
<div class="context-block context-search">
<h3><?php 
echo putGS('Available Articles');
?>
</h3>
<?php 
$contextlist = new ContextList();
$contextlist->setSearch(TRUE);
$contextlist->setOrder(TRUE);
$contextlist->setLanguage($f_language_id);
$contextlist->renderFilters();
$contextlist->render();
?>
</div>
<script>
                 $(function(){
                        $(".dataTables_filter input").attr("placeholder", "Search").addClass("context-search search");
                        //$("#table-<?php 
echo $contextlist->getId();
?>
_filter").css("border","0px");
                        $(".fg-toolbar .ui-toolbar .ui-widget-header .ui-corner-tl .ui-corner-tr .ui-helper-clearfix").css("border","none");
Exemplo n.º 2
0
 /**
  * Render table.
  * @return ArticleList
  */
 public function render()
 {
     $this->beforeRender();
     include dirname(__FILE__) . '/table.php';
     self::$renderTable = TRUE;
     echo '</div><!-- /#list-' . $this->id . ' -->';
     return $this;
 }
Exemplo n.º 3
0
    }
}
// filter out PrintDesk articles
$articlesParams[] = new ComparisonOperation('type', new Operator('not', 'string'), 'printdesk');
// search
if (isset($_REQUEST['sSearch']) && strlen($_REQUEST['sSearch']) > 0) {
    $search_phrase = $_REQUEST['sSearch'];
    //$articlesParams[] = new ComparisonOperation('search_phrase', new Operator('is', 'integer'), $search_phrase);
    $articlesParams[] = new ComparisonOperation('search_phrase', new Operator('like', 'string'), "__match_all." . $search_phrase);
}
// sorting
$sortOptions = array(0 => 'bynumber', 2 => 'bysectionorder', 3 => 'byname', 12 => 'bycomments', 13 => 'bypopularity', 16 => 'bycreationdate', 17 => 'bypublishdate');
$sortBy = 'bysectionorder';
$sortDir = 'asc';
$sortingCols = min(1, (int) $_REQUEST['iSortingCols']);
for ($i = 0; $i < $sortingCols; $i++) {
    $sortOptionsKey = (int) $_REQUEST['iSortCol_' . $i];
    if (!empty($sortOptions[$sortOptionsKey])) {
        $sortBy = $sortOptions[$sortOptionsKey];
        $sortDir = $_REQUEST['sSortDir_' . $i];
        break;
    }
}
// get articles
$articles = Article::GetList($articlesParams, array(array('field' => $sortBy, 'dir' => $sortDir)), $start, $limit, $articlesCount, true);
$list = new ContextList(TRUE);
$return = array();
foreach ($articles as $article) {
    $return[] = $list->processItem($article);
}
return array('iTotalRecords' => Article::GetTotalCount(), 'iTotalDisplayRecords' => $articlesCount, 'sEcho' => (int) $_REQUEST['sEcho'], 'aaData' => $return);