actuality

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2012-10-30 18:07:06 +01:00
parent 2248bfd12e
commit f8af96a85b
4 changed files with 159 additions and 27 deletions

View File

@@ -70,9 +70,17 @@ function materio_search_api_menu() {
$items['explore'] = $base+array(
'access arguments' => array('use materio search api'),
'page callback' => 'materio_search_api_results_search',
'title' => t('Explore'),
//'page argument' => array(1,2,3),
);
$items['actuality'] = $base+array(
// 'access arguments' => array(),
'page callback' => 'materio_search_api_actuality',
// 'page argument' => array(),
'access callback' => TRUE,
);
$items['materiosearchapi/viewmode/change'] = $base+array(
'access arguments' => array('use materio search api'),
'page callback' => 'materio_search_api_viewmode_change',
@@ -306,9 +314,33 @@ function materio_search_api_theme($existing, $type, $theme, $path) {
'pager' => NULL,
),
),
// 'materio_search_api_performance' => array(
// 'render element' => 'element',
// ),
'materio_search_api_actuality' => array(
'template' => 'materio-search-api-actuality',
'path' => drupal_get_path('module', 'materio_search_api').'/templates',
'arguments' => array(
'items' => array(),
'view_mode' => "teaser",
'pager' => NULL,
'count' => 0,
)
)
);
}
/**
* Implements theme for rendering search-performance
*/
// function theme_materio_search_api_performance($variables) {
// $element = array_shift($variables);
// return $element['#markup'];
// }
/**
* template_preprocess_materiobase_search_block();
*/
@@ -389,17 +421,12 @@ function template_preprocess_materio_search_api_results(array &$variables) {
$variables['items'] = $variables['index']->loadItems(array_keys($variables['results']['results']));
$variables['result_count'] = $results['result count'];
$variables['sec'] = round($results['performance']['complete'], 3);
$variables['search_performance'] = array(
'#theme' => 'search_performance',
'#markup' => format_plural(
$variables['search_performance'] = format_plural(
$results['result count'],
'The search found 1 result in @sec seconds.',
'The search found @count results in @sec seconds.',
'The search found 1 result.', // in @sec seconds
'The search found @count results.', // in @sec seconds
array('@sec' => $variables['sec'])
),
'#prefix' => '<p class="search-performance">',
'#suffix' => '</p>',
);
);
// $variables['search_results'] = array(
// '#theme' => 'search_results_list',
@@ -409,10 +436,21 @@ function template_preprocess_materio_search_api_results(array &$variables) {
// 'type' => 'ul',
// );
// dsm($variables, 'variables');
//dsm($variables, 'variables');
}
function template_preprocess_materio_search_api_actuality(&$vars){
// dsm($vars, 'template_preprocess_materio_search_api_actuality | vars');
// $items = array();
// foreach ($vars['items'] as $nid => $item) {
// $items[] = node_load($nid);
// }
// $vars['items'] = $items;
}
/**
* - - - - - - - - - - - - SEARCH API PAGE - - - - - - - - - - - -
*/