" . t('Login') . '' . " | " . t('Register') . ""; } function admire_grunge_welcome_user(){ global $user; $usr_path = 'user/'.$user->uid; $myAccount = drupal_get_path_alias($usr_path); $logout = drupal_get_path_alias('user/logout'); if($user->uid) { $output = theme('item_list', $vars = array ( 'items' => array( l(t('My account |'), $myAccount, array('title' => t('My account'))), l(t(' Sign out'), $logout)), 'type' => 'ul', ) ); return $output; } return; } function admire_grunge_preprocess_node(&$variables) { if ($variables['submitted']) { $variables['submitted'] = t('!day
!datetime', array('!day' => format_date($variables['created'],'custom','D'), '!datetime' => format_date($variables['created'],'custom','m/d/y'))); } } function admire_grunge_comment_submitted($comment) { return t('@day @datetime by !username', array( '!username' => theme('username', $comment), '@day' => format_date($comment->timestamp,'custom','D'), '@datetime' => format_date($comment->timestamp,'custom','m/d/y'), )); } function admire_grunge_preprocess_comment(&$variables) { $created = $variables['created']; $author = $variables['author']; $variables['submitted'] = "on $created by $author"; } function admire_grunge_preprocess_block(&$variables) { if ($variables['block_html_id'] === 'desired-id') { // do something for this block } } //modify comment form function admire_grunge_form($variables) { if($variables['element']['#id'] == 'comment-form'){ $element = $variables['element']; if (isset($element['#action'])) { $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']); } element_set_attributes($element, array('method', 'id')); if (empty($element['#attributes']['accept-charset'])) { $element['#attributes']['accept-charset'] = "UTF-8"; } // Anonymous DIV to satisfy XHTML compliance. return '
' . $element['#children'] . '
'; } else{ $element = $variables['element']; if (isset($element['#action'])) { $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']); } element_set_attributes($element, array('method', 'id')); if (empty($element['#attributes']['accept-charset'])) { $element['#attributes']['accept-charset'] = "UTF-8"; } // Anonymous DIV to satisfy XHTML compliance. return '
' . $element['#children'] . '
'; } } // Append mainbody and sidebar state classes to classes_array function admire_grunge_preprocess_html(&$variables) { $page = $variables['page']; $sidebar_first = (isset($page['sidebar_first']))? $page['sidebar_first'] : NULL; $sidebar_last = (isset($page['sidebar_last']))? $page['sidebar_last'] : NULL; $right_dark = (isset($page['right_dark']))? $page['right_dark'] : NULL; $variables['classes_array'][] = 'mainbody'; $variables['classes_array'][] = trim(get_sidebar_state($sidebar_first, $sidebar_last, $right_dark)); }