Skip to content

Commit

Permalink
Coder review for patterns_client.module
Browse files Browse the repository at this point in the history
  • Loading branch information
drozas committed Aug 15, 2013
1 parent 735a1a7 commit c38f19f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion patterns_client.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ description = Allows the exchange (push/pull) of pattern files from any site run
core = 7.x

package = Patterns
dependencies[] = patterns (>=7.x-2.x-dev)
dependencies[] = patterns (7.x-2.x-dev)
dependencies[] = d2d
14 changes: 8 additions & 6 deletions patterns_client.module
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ module_load_include('inc', 'patterns_client', 'includes/io');
/**
* Implements hook_help().
*/
function patterns_client_help($path,$arg) {
function patterns_client_help($path, $arg) {
switch ($path) {
case "admin/help#patterns_client":
return '<p>'.t("Help for patterns_client module").'<p>';
return '<p>' . t("Help for patterns_client module") . '<p>';
break;
}
}
Expand Down Expand Up @@ -166,7 +166,8 @@ function patterns_client_search_form($form, &$form_state) {
$patterns_list = array();
if (!isset($form_state['input']['patterns_list'])) {
$patterns_list = _patterns_client_get_patterns_server_list(10000);
}else{
}
else{
$patterns_list = $form_state['input']['patterns_list'];
// In case a search query has been perforem, add extra "view all" button
$form['patterns_search']['actions']['view_all'] = array(
Expand Down Expand Up @@ -198,7 +199,7 @@ function patterns_client_search_form($form, &$form_state) {
array('data' => $pattern['description']),
array('data' => $pattern['author']),
array('data' => $pattern['format']),
array('data' => l(t('Preview'), $pattern['view_url'], array('attributes'=>array('target'=>'blank')))),
array('data' => l(t('Preview'), $pattern['view_url'], array('attributes' => array('target' => 'blank')))),
array('data' => (_patterns_client_row_count_uuuid($pattern['uuuid']) > 0) ? t('Already pulled'): l(t('Pull'), 'admin/patterns/remote/fetch/' . $pattern['pid'])),
);
}
Expand All @@ -210,7 +211,8 @@ function patterns_client_search_form($form, &$form_state) {
'#empty' => t('Empty Rows')
);

}else{
}
else{
// Display a message to inform about no results found
if (isset($patterns_list)) {
drupal_set_message(t('No patterns matched the given criteria'), 'status');
Expand Down Expand Up @@ -253,7 +255,7 @@ function patterns_client_search_form_submit($form, &$form_state) {
$token = $form_state['values']['search'];
$type = $form_state['values']['selected'];
$form_state['input']['patterns_list'] = _patterns_client_search_server_pattern($token, $type);
$form_state['rebuild'] = true;
$form_state['rebuild'] = TRUE;
}

/**
Expand Down

0 comments on commit c38f19f

Please sign in to comment.