| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id$
|
| 4 |
|
| 5 |
// Copyright Khalid Baheyeldin 2006-2009 http://2bits.com
|
| 6 |
|
| 7 |
define('RESUME_NODE_TYPE', 'resume_node_type_');
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_help().
|
| 11 |
*/
|
| 12 |
function resume_help($path, $arg) {
|
| 13 |
switch ($path) {
|
| 14 |
case 'admin/help#resume':
|
| 15 |
return t('Allows users to post resumes and use them to apply for jobs.');
|
| 16 |
}
|
| 17 |
}
|
| 18 |
|
| 19 |
/**
|
| 20 |
* Implementation of hook_menu().
|
| 21 |
*/
|
| 22 |
function resume_menu() {
|
| 23 |
$items['admin/settings/resume'] = array(
|
| 24 |
'title' => 'Resume',
|
| 25 |
'description' => 'Resume settings.',
|
| 26 |
'page callback' => 'drupal_get_form',
|
| 27 |
'page arguments' => array('resume_admin_settings'),
|
| 28 |
'access arguments' => array('administer site configuration'),
|
| 29 |
);
|
| 30 |
return $items;
|
| 31 |
}
|
| 32 |
|
| 33 |
function resume_admin_settings() {
|
| 34 |
$set = 'resume';
|
| 35 |
$form[$set] = array(
|
| 36 |
'#type' => 'fieldset',
|
| 37 |
'#title' => t('Enable resume for these content types'),
|
| 38 |
);
|
| 39 |
|
| 40 |
foreach(node_get_types() as $type => $name) {
|
| 41 |
$form[$set][RESUME_NODE_TYPE . $type] = array(
|
| 42 |
'#type' => 'checkbox',
|
| 43 |
'#title' => $type,
|
| 44 |
'#return_value' => 1,
|
| 45 |
'#default_value' => variable_get(RESUME_NODE_TYPE . $type, 0),
|
| 46 |
);
|
| 47 |
}
|
| 48 |
|
| 49 |
return system_settings_form($form);
|
| 50 |
}
|
| 51 |
|
| 52 |
function resume_search_item($item) {
|
| 53 |
return theme('resume_search_item', $item);
|
| 54 |
}
|
| 55 |
|
| 56 |
function theme_resume_search_item($item) {
|
| 57 |
$output .= '<div id="resume_search">';
|
| 58 |
$output .= l($item['title'], $item['link']) . '<br />';
|
| 59 |
$output .= $item['snippet']. '<br />';
|
| 60 |
$output .= $item['user'] . ' | ' . format_date($item['date'], 'small'). '<br /><br />';
|
| 61 |
$output .= '</div>';
|
| 62 |
|
| 63 |
return $output ;
|
| 64 |
}
|
| 65 |
|
| 66 |
/**
|
| 67 |
* Implementation of hook_theme().
|
| 68 |
*/
|
| 69 |
function resume_theme() {
|
| 70 |
return array(
|
| 71 |
'resume_search_item' => array(
|
| 72 |
'arguments' => array(
|
| 73 |
'item' => NULL,
|
| 74 |
)
|
| 75 |
)
|
| 76 |
);
|
| 77 |
}
|
| 78 |
|