CMS
Version 3.9
video_blog_handler.inc
Go to the documentation of this file.
1
<?php
7
/**************************************************************
8
9
Copyright (c) 2010 Sonjara, Inc
10
11
Permission is hereby granted, free of charge, to any person
12
obtaining a copy of this software and associated documentation
13
files (the "Software"), to deal in the Software without
14
restriction, including without limitation the rights to use,
15
copy, modify, merge, publish, distribute, sublicense, and/or sell
16
copies of the Software, and to permit persons to whom the
17
Software is furnished to do so, subject to the following
18
conditions:
19
20
The above copyright notice and this permission notice shall be
21
included in all copies or substantial portions of the Software.
22
23
Except as contained in this notice, the name(s) of the above
24
copyright holders shall not be used in advertising or otherwise
25
to promote the sale, use or other dealings in this Software
26
without prior written authorization.
27
28
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
30
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
32
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
33
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
34
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35
OTHER DEALINGS IN THE SOFTWARE.
36
37
*****************************************************************/
38
39
Fakoli::using
(
"blog"
);
40
41
class
VideoBlogHandler
implements
IBlogViewHandler
42
{
43
var
$blog
;
44
45
function
VideoBlogHandler
()
46
{
47
}
48
49
static
function
register
(
$view
)
50
{
51
$view
->registerHandler(
"Video"
,
new
VideoBlogHandler
());
52
return
$view
;
53
}
54
55
function
drawArticleList
(
$blog
)
56
{
57
global
$page
;
58
global
$script
;
59
60
$script
.= <<<ENDSCRIPT
61
<script type=
"text/javascript"
>
62
window.addEvent(
'domready'
,
function
()
63
{
64
$$(
"#article_list a"
).each(
function
(elt)
65
{
66
elt.addEvents(
67
{
68
'mouseover'
:
function
()
69
{
70
this.morph({
'background-color'
:
'#A9CDED'
,
'border-color'
:
'#666666'
});
71
}.bind(elt),
72
'mouseout'
:
function
()
73
{
74
this.morph({
'background-color'
:
'#DEFAFF'
,
'border-color'
:
'#cccccc'
});
75
}.bind(elt)
76
});
77
});
78
});
79
</script>
80
ENDSCRIPT;
81
82
$this->blog =
$blog
;
83
84
$page
->page_title =
$blog
->title;
85
86
$articles
=
$blog
->Articles(
"WHERE published=1 ORDER BY created_date {$this->blog->default_article_order}"
);
87
88
echo
"<div id='blog_description' class='Video'>{$blog->description}</div>"
;
89
90
$list
=
new
PagedList(
$articles
,
"article_list"
, array($this,
formatArticle
));
91
$list
->CSSclass =
"Video"
;
92
$list
->styles =
"clear: both"
;
93
$list
->pageSize = 5;
94
95
$script
.=
$list
->writeScript();
96
$list
->drawList();
97
}
98
99
function
formatArticle
(
$article
)
100
{
101
$out
=
"<a href='/{$this->blog->identifier}?article_id={$article->article_id}' style='display: block'>"
;
102
if
(
$article
->image_id)
103
{
104
$image
=
$article
->Image();
105
$out
.=
"<img src='/action/image/thumbnail?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>"
;
106
}
107
108
$out
.=
"<div class='article_summary'><h4>{$article->title}</h4>"
;
109
if
(
$article
->teaser)
$out
.=
$article
->teaser;
110
$out
.=
"</div><div style='clear: both'></div></a>"
;
111
return
$out
;
112
}
113
114
function
drawArticle
(
$blog
,
$article_id
)
115
{
116
global
$page
;
117
$article
=
new
Article
(
$article_id
);
118
$page
->page_title =
$article
->title;
119
120
echo
$article
->message;
121
}
122
}?>
$script
$script
Definition:
activity_report.inc:37
$article
$article
Definition:
article_form.inc:39
$article_id
$article_id
Definition:
article_form.inc:40
$page
$page
Definition:
help.inc:39
$view
$view
Definition:
help.inc:42
$out
$out
Definition:
page.inc:66
$image
$image
Definition:
image_form.inc:46
Article
Defines the Article class.
Definition:
article.inc:45
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
VideoBlogHandler
Definition:
video_blog_handler.inc:42
VideoBlogHandler\drawArticleList
drawArticleList($blog)
Draw the list of articles for the specified blog.
Definition:
video_blog_handler.inc:55
VideoBlogHandler\formatArticle
formatArticle($article)
Definition:
video_blog_handler.inc:99
VideoBlogHandler\VideoBlogHandler
VideoBlogHandler()
Definition:
video_blog_handler.inc:45
VideoBlogHandler\drawArticle
drawArticle($blog, $article_id)
Draw the specific article in the blog.
Definition:
video_blog_handler.inc:114
VideoBlogHandler\$blog
$blog
Definition:
video_blog_handler.inc:43
IBlogViewHandler
IBlogViewHandler defines the interface that BlogViewHandlers must provide.
Definition:
blog_view.inc:48
$list
$list
Definition:
list_images.inc:41
$articles
$articles
Definition:
rss.inc:62
code
cms.sonjara.com
cms
components
video
video_blog_handler.inc
Generated on Tue Mar 23 2021 15:36:15 for CMS by
1.9.1