Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
library
uw_lib_refshelf
Commits
a8ca3907
Commit
a8ca3907
authored
Dec 21, 2017
by
Ganesharatnam
Browse files
fix for spelling mistakes
parent
21065ed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
uw_lib_refshelf.module
View file @
a8ca3907
...
...
@@ -27,7 +27,7 @@ function uw_lib_refshelf_data($param, $url) {
$uri
=
$url
.
$param
;
$file_headers
=
@
get_headers
(
$uri
);
if
(
!
$file_headers
||
$file_headers
[
0
]
==
'HTTP/1.1 404 Not Found'
)
{
drupal_set_message
(
t
(
'<h
3
>URL is not available to collect the data</h
3
>'
));
drupal_set_message
(
t
(
'<h
2
>URL is not available to collect the data</h
2
>'
));
}
else
{
$response
=
file_get_contents
(
$uri
);
...
...
@@ -54,12 +54,12 @@ function uw_lib_refshelf_render_data() {
if
(
isset
(
$_GET
[
'cat_id'
])
&&
!
empty
(
$_GET
[
'cat_id'
]))
{
//Displaying Subcategories
$tit
=
html_entity_decode
(
$_GET
[
'title'
]);
$txt
=
"<h
3
>"
.
$tit
.
"</h
3
><br />"
;
$txt
=
"<h
2
>"
.
$tit
.
"</h
2
><br />"
;
$_SESSION
[
'tit'
]
=
$txt
;
$qparam
=
$_GET
[
'cat_id'
];
$links
=
uw_lib_refshelf_get_links
(
$qparam
,
"toc_id"
);
if
(
empty
(
$links
))
{
$txt
=
"<h
3
>Resources for "
.
$tit
.
"</h
3
><br />"
;
$txt
=
"<h
2
>Resources for "
.
$tit
.
"</h
2
><br />"
;
$links
.
=
uw_lib_refshelf_get_links
(
$qparam
,
"resources"
);
}
$_SESSION
[
'toc_links'
]
=
$links
;
...
...
@@ -143,7 +143,8 @@ function uw_lib_refshelf_get_links($param, $str) {
$link_url
=
"?"
.
$str
.
"="
.
$id
.
"&title="
.
$link_name
;
}
if
(
isset
(
$element
[
'description'
]))
{
$page
.
=
'<div><a href="'
.
$link_url
.
'" target=\"_blank\">'
.
$link_name
.
'</a></div>'
;
//$page .= '<div><a href="' . $link_url . '" target=\"_blank\">' . $link_name . '</a></div>';
$page
.
=
'<div><a href="'
.
$link_url
.
'">'
.
$link_name
.
'</a></div>'
;
$page
.
=
"<div>"
.
$element
[
'description'
]
.
"</div><br />"
;
}
else
{
...
...
@@ -252,8 +253,9 @@ function uw_lib_refshelf_search($word) {
$no_duplicates
=
array_unique
(
$all
);
$records_cnt
=
count
(
$no_duplicates
);
$actual_records
=
$records_cnt
-
1
;
if
(
$records_cnt
<
25
)
{
$msg
=
"<br /><br /><div><h3>The follwing "
.
$actual_records
.
" results found for the key
word <b>"
.
$word
.
"</b></h3></div><br />"
;
$msg
=
"<br /><br /><div><h3>The foll
o
wing "
.
$actual_records
.
" results found for the keyword <b>"
.
$word
.
"</b></h3></div><br />"
;
if
(
!
empty
(
$no_duplicates
))
{
foreach
(
$no_duplicates
as
$result
)
{
$page
.
=
$result
;
...
...
@@ -301,7 +303,7 @@ function uw_lib_refshelf_view_results($no_duplicates, $word, $pagenum, $offset)
if
(
!
empty
(
$no_duplicates
))
{
if
(
$rec_count
>
$offset
)
{
$msg
=
"<br /><br /><br /><p><h3>The following results found for the key
word <b>"
.
$word
.
"</b></h3></p>"
;
$msg
=
"<br /><br /><br /><p><h3>The following results found for the keyword <b>"
.
$word
.
"</b></h3></p>"
;
$cnt
=
0
;
$c
=
0
;
foreach
(
$no_duplicates
as
$result
)
{
...
...
@@ -333,9 +335,10 @@ function uw_lib_refshelf_search_results($status, $desc, $link_name, $link_url, $
$page
=
""
;
$desc
=
uw_lib_refshelf_highlight_word
(
$word
,
$desc
);
$link_name
=
uw_lib_refshelf_highlight_word
(
$word
,
$link_name
);
if
(
$status
)
{
if
(
!
empty
(
$desc
))
{
$link
=
'<span class="ref_links"><a href="'
.
$link_url
.
'"
target=\"_blank\"
>'
.
$link_name
.
'</a></span>'
;
$link
=
'<span class="ref_links"><a href="'
.
$link_url
.
'">'
.
$link_name
.
'</a></span>'
;
$page
.
=
$link
.
"<p>"
.
$desc
.
"</p>"
;
}
else
{
...
...
@@ -385,8 +388,8 @@ function uw_lib_refshelf_keyword_search($word, $data) {
*/
function
uw_lib_refshelf_pagination
(
$pagenum
,
$left_rec
,
$rec_limit
)
{
if
(
$left_rec
<
$rec_limit
)
{
$last
=
$pagenum
-
2
;
$content
=
"<a href =
\"
?pagenum=
{
$last
}
\"
>Previous</a>"
;
$last
=
$pagenum
-
2
;
$content
=
"<a href =
\"
?pagenum=
{
$last
}
\"
>Previous</a>"
;
}
elseif
(
$pagenum
==
0
)
{
$content
=
"<a href =
\"
?pagenum=
{
$pagenum
}
\"
>Next</a>"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment