cleaning : removed some whitespaces

This commit is contained in:
Bachir Soussi Chiadmi 2014-09-10 21:05:17 +08:00
parent ef50154a49
commit 98f738f951
2 changed files with 410 additions and 40 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
function materio_search_api_ajax_search($page = 0){ function materio_search_api_ajax_search($page = 0){
$debug = false; $debug = false;
global $user, $base_url; global $user, $base_url;
// TODO: set research path configurable // TODO: set research path configurable
$search_path = "explore"; $search_path = "explore";
# execute search # execute search
@ -26,7 +26,7 @@ function materio_search_api_ajax_search($page = 0){
exit ; exit ;
} }
// TODO: if no permission, redirect to home // TODO: if no permission, redirect to home
# content type filter s # content type filter s
// $types = $_GET['types']; // $types = $_GET['types'];
@ -52,7 +52,7 @@ function materio_search_api_ajax_search($page = 0){
user_save($user, array("data"=>array('materiosearchapi_bundlesfilter' => $active_types))); user_save($user, array("data"=>array('materiosearchapi_bundlesfilter' => $active_types)));
# if we are not already on the search page then don't respond with search results but redirect to search page # if we are not already on the search page then don't respond with search results but redirect to search page
if(isset($_GET['current_path'])){ if(isset($_GET['current_path'])){
// url() generates the prefix using hook_url_outbound_alter(). Instead of // url() generates the prefix using hook_url_outbound_alter(). Instead of
// running the hook_url_outbound_alter() again here, extract the prefix // running the hook_url_outbound_alter() again here, extract the prefix
@ -77,7 +77,7 @@ function materio_search_api_ajax_search($page = 0){
// TODO implement the new search mode (only term) // TODO implement the new search mode (only term)
if(isset($_GET['searchmode'])){ if(isset($_GET['searchmode'])){
$searchmode = $_GET['searchmode']; $searchmode = $_GET['searchmode'];
user_save($user, array("data"=>array('materiosearchapi_searchmode' => $searchmode))); user_save($user, array("data"=>array('materiosearchapi_searchmode' => $searchmode)));
} }
// dsm($path, 'path'); // dsm($path, 'path');
@ -86,7 +86,7 @@ function materio_search_api_ajax_search($page = 0){
$return = menu_execute_active_handler($path, FALSE); $return = menu_execute_active_handler($path, FALSE);
//dsm($return, '$return'); //dsm($return, '$return');
if (is_int($return)) { if (is_int($return)) {
switch ($return) { switch ($return) {
case MENU_NOT_FOUND : case MENU_NOT_FOUND :
@ -106,7 +106,7 @@ function materio_search_api_ajax_search($page = 0){
$return = drupal_render($return); $return = drupal_render($return);
// $return = theme($return['#theme'], $return); // $return = theme($return['#theme'], $return);
} }
$rep = array( $rep = array(
'path'=>$search_path.'/'.$keys_encoded, 'path'=>$search_path.'/'.$keys_encoded,
'keys'=>$keys, 'keys'=>$keys,
@ -119,14 +119,14 @@ function materio_search_api_ajax_search($page = 0){
if(isset($count)) if(isset($count))
$rep['count'] = $count; $rep['count'] = $count;
if ($debug) { if ($debug) {
//dsm($rep, 'rep'); //dsm($rep, 'rep');
return "debug display"; return "debug display";
}else{ }else{
drupal_json_output($rep); drupal_json_output($rep);
} }
} }
} }
@ -148,14 +148,14 @@ function materio_search_api_ajax_viewmode_change($vm){
// } // }
$_GET['page'] = 0; $_GET['page'] = 0;
$rep = _materio_search_api_change_viewmode($vm); $rep = _materio_search_api_change_viewmode($vm);
drupal_json_output($rep); drupal_json_output($rep);
} }
function materio_search_api_ajax_actuality($page = 0){ function materio_search_api_ajax_actuality($page = 0){
$debug = false; $debug = false;
$_GET['page'] = $page; $_GET['page'] = $page;
$path = 'actuality'; $path = 'actuality';
@ -187,13 +187,13 @@ function materio_search_api_ajax_actuality($page = 0){
// } // }
// } // }
// get results // get results
menu_set_active_item($path); menu_set_active_item($path);
$return = menu_execute_active_handler($path, FALSE); $return = menu_execute_active_handler($path, FALSE);
//dsm($return, '$return'); //dsm($return, '$return');
if (is_int($return)) { if (is_int($return)) {
switch ($return) { switch ($return) {
case MENU_NOT_FOUND : case MENU_NOT_FOUND :
@ -211,25 +211,25 @@ function materio_search_api_ajax_actuality($page = 0){
if (is_array($return)) { if (is_array($return)) {
$return = drupal_render($return); $return = drupal_render($return);
} }
$rep = array( $rep = array(
'path' => $path, 'path' => $path,
'returned'=>$return, 'returned'=>$return,
'title' => drupal_get_title(), 'title' => drupal_get_title(),
); );
if ($debug) { if ($debug) {
//dsm($rep, 'rep'); //dsm($rep, 'rep');
return "debug display"; return "debug display";
}else{ }else{
drupal_json_output($rep); drupal_json_output($rep);
} }
} }
} }
function materio_search_api_ajax_node($nid){ function materio_search_api_ajax_node($nid){
global $user; global $user;
$viewmode = isset($_GET['viewmode']) ? $_GET['viewmode'] : (isset($user->data['materiosearchapi_viewmode']) ? $user->data['materiosearchapi_viewmode'] : variable_get('defaultviewmode', 'full')); $viewmode = isset($_GET['viewmode']) ? $_GET['viewmode'] : (isset($user->data['materiosearchapi_viewmode']) ? $user->data['materiosearchapi_viewmode'] : variable_get('defaultviewmode', 'full'));
$rep = array( $rep = array(
@ -242,6 +242,6 @@ function materio_search_api_ajax_node($nid){
'nid' => $nid, 'nid' => $nid,
'node' => drupal_render($nodeview), 'node' => drupal_render($nodeview),
); );
drupal_json_output($rep); drupal_json_output($rep);
} }
} }