diff options
author | Jayaram R Pai | 2014-07-30 18:12:23 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-07-30 18:12:23 +0530 |
commit | f83ffd87d4decbbe05a4c8a26c4c9860c223e72e (patch) | |
tree | f4b765d76b5c431b563134f15caa6f0e4ad80179 /job_portal.module | |
parent | c446c2b1a27df3e38ad788f2ed5cd4d0415b58d3 (diff) | |
download | job_portal-f83ffd87d4decbbe05a4c8a26c4c9860c223e72e.tar.gz job_portal-f83ffd87d4decbbe05a4c8a26c4c9860c223e72e.tar.bz2 job_portal-f83ffd87d4decbbe05a4c8a26c4c9860c223e72e.zip |
added quick_links for jobs page
Diffstat (limited to 'job_portal.module')
-rw-r--r-- | job_portal.module | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/job_portal.module b/job_portal.module index bc98aa5..667e8e6 100644 --- a/job_portal.module +++ b/job_portal.module @@ -185,9 +185,11 @@ FOSSEE Team } function job_portal_page() { - $result = get_jobs_available(); - $output = ""; + $output = ""; + $quick_links = ""; $i = 1; + + $result = get_jobs_available(); foreach($result as $row) { $collapser_header = "#{$i} - {$row->project} - Job Details"; $collapser_content = " @@ -205,11 +207,17 @@ FOSSEE Team "html" => TRUE, )); $collapser_content .= "</center>"; - $output .= collapser($collapser_header, $collapser_content); + $output .= collapser($collapser_header, $collapser_content, "", $i); + $quick_links .= "<a class='badge quick' data-toggle='tooltip' data-placement='right' title='{$row->project}' href='#fieldset-id-{$i}'>{$i}</a><br>"; $i++; } $output = array( + "quick_links" => array( + "#prefix" => "<div id='quick-links'>", + "#markup" => $quick_links, + "#suffix" => "</div>", + ), "job_description" => array( "#prefix" => "<div id='job-description'>", "#markup" => $output, @@ -302,12 +310,22 @@ FOSSEE Team function job_portal_init() { drupal_add_js("misc/form.js"); drupal_add_js("misc/collapse.js"); + drupal_add_js( + drupal_get_path('module', 'job_portal') . '/js/smooth_scroll.js', + array( + 'group' => JS_THEME, + 'weight' => 20, + 'every_page' => TRUE, + 'cache' => TRUE, + 'scope' => 'header', + ) + ); } /* helper functions */ - function collapser($title="", $content="", $description="") { + function collapser($title="", $content="", $description="", $key="") { return " - <fieldset id='fieldset-id' class='collapsible'> + <fieldset id='fieldset-id-{$key}' class='collapsible'> <legend> <a class='fieldset-title' href='#'> <span class='fieldset-legend'>{$title}</span> |