Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Feeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MickGe
Feeds
Commits
989b399e
Commit
989b399e
authored
12 years ago
by
Andrew Dolgov
Browse files
Options
Downloads
Patches
Plain Diff
add a close article panel plugin (refs #538)
parent
f03701fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/close_button/button.png
+0
-0
0 additions, 0 deletions
plugins/close_button/button.png
plugins/close_button/init.php
+49
-0
49 additions, 0 deletions
plugins/close_button/init.php
with
49 additions
and
0 deletions
plugins/close_button/button.png
0 → 100644
+
0
−
0
View file @
989b399e
3.56 KiB
This diff is collapsed.
Click to expand it.
plugins/close_button/init.php
0 → 100644
+
49
−
0
View file @
989b399e
<?php
class
Close_Button
extends
Plugin
{
private
$link
;
private
$host
;
function
init
(
$host
)
{
$this
->
link
=
$host
->
get_link
();
$this
->
host
=
$host
;
$host
->
add_hook
(
$host
::
HOOK_ARTICLE_BUTTON
,
$this
);
}
function
about
()
{
return
array
(
1.0
,
"Adds a button to close article panel"
,
"fox"
);
}
function
hook_article_button
(
$line
)
{
if
(
!
get_pref
(
$this
->
link
,
"COMBINED_DISPLAY_MODE"
))
{
$rv
=
"<img src=
\"
"
.
theme_image
(
$this
->
link
,
'plugins/close_button/button.png'
)
.
"
\"
class='tagsPic' style=
\"
cursor : pointer
\"
onclick=
\"
closeArticlePanel()
\"
title='"
.
__
(
'Close article'
)
.
"'>"
;
}
return
$rv
;
}
function
getInfo
()
{
$id
=
db_escape_string
(
$_REQUEST
[
'id'
]);
$result
=
db_query
(
$this
->
link
,
"SELECT title, link
FROM ttrss_entries, ttrss_user_entries
WHERE id = '
$id
' AND ref_id = id AND owner_uid = "
.
$_SESSION
[
'uid'
]);
if
(
db_num_rows
(
$result
)
!=
0
)
{
$title
=
truncate_string
(
strip_tags
(
db_fetch_result
(
$result
,
0
,
'title'
)),
100
,
'...'
);
$article_link
=
db_fetch_result
(
$result
,
0
,
'link'
);
}
print
json_encode
(
array
(
"title"
=>
$title
,
"link"
=>
$article_link
,
"id"
=>
$id
));
}
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment