Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
be280193
Commit
be280193
authored
Jul 28, 2012
by
dawehner
Committed by
tim.plunkett
Oct 21, 2012
Browse files
moved aggregator,book,comment
parent
684b4a03
Changes
157
Hide whitespace changes
Inline
Side-by-side
lib/Drupal/aggregator/Plugin/views/argument/
views_handler_argument_aggregator_c
ategory
_c
id.
inc
→
lib/Drupal/aggregator/Plugin/views/argument/
C
ategory
C
id.
php
View file @
be280193
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_argument_aggregator_category_cid.
*/
namespace
Drupal\aggregator\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\Numeric
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept an aggregator category id.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_aggregator_category_cid
extends
Numeric
{
/**
* @Plugin(
* plugin_id = "aggregator_category_cid"
* )
*/
class
CategoryCid
extends
Numeric
{
/**
* Override the behavior of title(). Get the title of the category.
*/
...
...
lib/Drupal/aggregator/Plugin/views/argument/
views_handler_argument_aggregator_fid.inc
→
lib/Drupal/aggregator/Plugin/views/argument/
Fid.php
View file @
be280193
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_argument_aggregator_fid.
*/
namespace
Drupal\aggregator\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\Numeric
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept an aggregator feed id.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_aggregator_fid
extends
Numeric
{
/**
* @Plugin(
* plugin_id = "aggregator_fid"
* )
*/
class
Fid
extends
Numeric
{
/**
* Override the behavior of title(). Get the title of the feed.
*/
...
...
modules
/aggregator/
views_handler_argument_aggregator_iid.inc
→
lib/Drupal
/aggregator/
Plugin/views/argument/Iid.php
View file @
be280193
...
...
@@ -5,13 +5,22 @@
* Definition of views_handler_argument_aggregator_iid.
*/
namespace
Drupal\aggregator\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\Numeric
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept an aggregator item id.
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "aggregator_iid"
* )
*/
class
views_handler_argument_aggregator_iid
extends
Numeric
{
/**
* Override the behavior of title(). Get the title of the category.
...
...
lib/Drupal/aggregator/Plugin/views/argument/views_handler_argument_aggregator_iid.inc
deleted
100644 → 0
View file @
684b4a03
<?php
/**
* @file
* Definition of views_handler_argument_aggregator_iid.
*/
use
Drupal\views\Plugins\views\argument\Numeric
;
/**
* Argument handler to accept an aggregator item id.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_aggregator_iid
extends
Numeric
{
/**
* Override the behavior of title(). Get the title of the category.
*/
function
title_query
()
{
$titles
=
array
();
$placeholders
=
implode
(
', '
,
array_fill
(
0
,
sizeof
(
$this
->
value
),
'%d'
));
$result
=
db_select
(
'aggregator_item'
)
->
condition
(
'iid'
,
$this
->
value
,
'IN'
)
->
fields
(
array
(
'title'
))
->
execute
();
foreach
(
$result
as
$term
)
{
$titles
[]
=
check_plain
(
$term
->
title
);
}
return
$titles
;
}
}
modules
/aggregator/
views_handler_field_aggregator_c
ategory.
inc
→
lib/Drupal
/aggregator/
Plugin/views/field/C
ategory.
php
View file @
be280193
...
...
@@ -5,7 +5,10 @@
* Definition of views_handler_field_aggregator_category.
*/
namespace
Drupal\aggregator\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to provide simple renderer that allows linking to aggregator
...
...
@@ -13,7 +16,13 @@
*
* @ingroup views_field_handlers
*/
class
views_handler_field_aggregator_category
extends
FieldPluginBase
{
/**
* @Plugin(
* plugin_id = "aggregator_category"
* )
*/
class
Category
extends
FieldPluginBase
{
/**
* Constructor to provide additional field to add.
*/
...
...
lib/Drupal/aggregator/Plugin/views/field/
views_handler_field_aggregator_t
itle
_l
ink.
inc
→
lib/Drupal/aggregator/Plugin/views/field/
T
itle
L
ink.
php
View file @
be280193
...
...
@@ -5,7 +5,10 @@
* Definition of views_handler_field_aggregator_title_link.
*/
namespace
Drupal\aggregator\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler that turns an item's title into a clickable link to the original
...
...
@@ -13,7 +16,13 @@
*
* @ingroup views_field_handlers
*/
class
views_handler_field_aggregator_title_link
extends
FieldPluginBase
{
/**
* @Plugin(
* plugin_id = "aggregator_title_link"
* )
*/
class
TitleLink
extends
FieldPluginBase
{
function
construct
()
{
parent
::
construct
();
$this
->
additional_fields
[
'link'
]
=
'link'
;
...
...
modules
/aggregator/
views_handler_field_aggregator_xss.inc
→
lib/Drupal
/aggregator/
Plugin/views/field/Xss.php
View file @
be280193
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_field_aggregator_xss.
*/
namespace
Drupal\aggregator\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Filters htmls tags from item.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_aggregator_xss
extends
FieldPluginBase
{
/**
* @Plugin(
* plugin_id = "aggregator_xss"
* )
*/
class
Xss
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
aggregator_filter_xss
(
$value
);
...
...
lib/Drupal/aggregator/Plugin/views/field/views_handler_field_aggregator_category.inc
deleted
100644 → 0
View file @
684b4a03
<?php
/**
* @file
* Definition of views_handler_field_aggregator_category.
*/
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
/**
* Field handler to provide simple renderer that allows linking to aggregator
* category.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_aggregator_category
extends
FieldPluginBase
{
/**
* Constructor to provide additional field to add.
*/
function
construct
()
{
parent
::
construct
();
$this
->
additional_fields
[
'cid'
]
=
'cid'
;
}
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'link_to_category'
]
=
array
(
'default'
=>
FALSE
,
'bool'
=>
TRUE
);
return
$options
;
}
/**
* Provide link to category option
*/
function
options_form
(
&
$form
,
&
$form_state
)
{
$form
[
'link_to_category'
]
=
array
(
'#title'
=>
t
(
'Link this field to its aggregator category page'
),
'#description'
=>
t
(
'This will override any other link you have set.'
),
'#type'
=>
'checkbox'
,
'#default_value'
=>
!
empty
(
$this
->
options
[
'link_to_category'
]),
);
parent
::
options_form
(
$form
,
$form_state
);
}
/**
* Render whatever the data is as a link to the category.
*
* Data should be made XSS safe prior to calling this function.
*/
function
render_link
(
$data
,
$values
)
{
$cid
=
$this
->
get_value
(
$values
,
'cid'
);
if
(
!
empty
(
$this
->
options
[
'link_to_category'
])
&&
!
empty
(
$cid
)
&&
$data
!==
NULL
&&
$data
!==
''
)
{
$this
->
options
[
'alter'
][
'make_link'
]
=
TRUE
;
$this
->
options
[
'alter'
][
'path'
]
=
"aggregator/category/
$cid
"
;
}
return
$data
;
}
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
$this
->
render_link
(
$this
->
sanitize_value
(
$value
),
$values
);
}
}
lib/Drupal/aggregator/Plugin/views/field/views_handler_field_aggregator_xss.inc
deleted
100644 → 0
View file @
684b4a03
<?php
/**
* @file
* Definition of views_handler_field_aggregator_xss.
*/
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
/**
* Filters htmls tags from item.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_aggregator_xss
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
aggregator_filter_xss
(
$value
);
}
}
modules
/aggregator/
views_handler_filter_aggregator_c
ategory
_c
id.
inc
→
lib/Drupal
/aggregator/
Plugin/views/filter/C
ategory
C
id.
php
View file @
be280193
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_filter_aggregator_category_cid.
*/
namespace
Drupal\aggregator\Plugin\views\filter
;
use
Drupal\views\Plugins\views\filter\InOperator
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Filter by aggregator category cid
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_aggregator_category_cid
extends
InOperator
{
/**
* @Plugin(
* plugin_id = "aggregator_category_cid"
* )
*/
class
CategoryCid
extends
InOperator
{
function
get_value_options
()
{
if
(
isset
(
$this
->
value_options
))
{
return
;
...
...
lib/Drupal/aggregator/Plugin/views/filter/views_handler_filter_aggregator_category_cid.inc
deleted
100644 → 0
View file @
684b4a03
<?php
/**
* @file
* Definition of views_handler_filter_aggregator_category_cid.
*/
use
Drupal\views\Plugins\views\filter\InOperator
;
/**
* Filter by aggregator category cid
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_aggregator_category_cid
extends
InOperator
{
function
get_value_options
()
{
if
(
isset
(
$this
->
value_options
))
{
return
;
}
$this
->
value_options
=
array
();
$result
=
db_query
(
'SELECT * FROM {aggregator_category} ORDER BY title'
);
foreach
(
$result
as
$category
)
{
$this
->
value_options
[
$category
->
cid
]
=
$category
->
title
;
}
}
}
lib/Drupal/aggregator/Plugin/views/row/
views_plugin_row_aggregator_rss.inc
→
lib/Drupal/aggregator/Plugin/views/row/
Rss.php
View file @
be280193
...
...
@@ -5,12 +5,26 @@
* Contains the Aggregator Item RSS row style plugin.
*/
namespace
Drupal\aggregator\Plugin\views\row
;
use
Drupal\views\Plugins\views\row\RowPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\Core\Annotation\Translation
;
/**
* Plugin which loads an aggregator item and formats it as an RSS item.
*
* @Plugin(
* plugin_id = "aggregator_rss",
* theme = "views_view_row_rss",
* title = @Translation("Aggregator item"),
* help = @Translation("Display the aggregator item using the data from the original source."),
* uses_options = TRUE,
* type = "feed",
* help_topic = "style-aggregator-rss"
* )
*/
class
views_plugin_row_aggregator_r
ss
extends
RowPluginBase
{
class
R
ss
extends
RowPluginBase
{
var
$base_table
=
'aggregator_item'
;
var
$base_field
=
'iid'
;
...
...
lib/Drupal/book/Plugin/views/argument_default/
views_plugin_argument_default_book_r
oot.
inc
→
lib/Drupal/book/Plugin/views/argument_default/
R
oot.
php
View file @
be280193
...
...
@@ -4,12 +4,23 @@
* Contains the book root from current node argument default plugin.
*/
use
Drupal\views\Plugins\views\argument_default
\
Node
;
namespace
Drupal\book\Plugin\views\argument_default
;
use
Views\node\Plugin\views\argument_default
\
Node
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\Core\Annotation\Translation
;
/**
* Default argument plugin to get the current node's book root.
*/
class
views_plugin_argument_default_book_root
extends
Node
{
/**
* @Plugin(
* plugin_id = "book_root",
* title = @Translation("Book root from current node")
* )
*/
class
Root
extends
Node
{
function
get_argument
()
{
// Use the argument_default_node plugin to get the nid argument.
$nid
=
parent
::
get_argument
();
...
...
modules/comment/views_handler_argument_comment_u
ser
_u
id.
inc
→
lib/Drupal/comment/Plugin/views/argument/U
ser
U
id.
php
View file @
be280193
...
...
@@ -5,13 +5,24 @@
* Definition of views_handler_argument_comment_user_uid.
*/
namespace
Drupal\comment\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\ArgumentPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler to accept a user id to check for nodes that
* user posted or commented on.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_comment_user_uid
extends
views_handler_argument
{
/**
* @Plugin(
* plugin_id = "argument_comment_user_uid"
* )
*/
class
UserUid
extends
ArgumentPluginBase
{
function
title
()
{
if
(
!
$this
->
argument
)
{
$title
=
variable_get
(
'anonymous'
,
t
(
'Anonymous'
));
...
...
lib/Drupal/comment/Plugin/views/argument/views_handler_argument_comment_user_uid.inc
deleted
100644 → 0
View file @
684b4a03
<?php
/**
* @file
* Definition of views_handler_argument_comment_user_uid.
*/
/**
* Argument handler to accept a user id to check for nodes that
* user posted or commented on.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_comment_user_uid
extends
views_handler_argument
{
function
title
()
{
if
(
!
$this
->
argument
)
{
$title
=
variable_get
(
'anonymous'
,
t
(
'Anonymous'
));
}
else
{
$title
=
db_query
(
'SELECT u.name FROM {users} u WHERE u.uid = :uid'
,
array
(
':uid'
=>
$this
->
argument
))
->
fetchField
();
}
if
(
empty
(
$title
))
{
return
t
(
'No user'
);
}
return
check_plain
(
$title
);
}
function
default_actions
(
$which
=
NULL
)
{
// Disallow summary views on this argument.
if
(
!
$which
)
{
$actions
=
parent
::
default_actions
();
unset
(
$actions
[
'summary asc'
]);
unset
(
$actions
[
'summary desc'
]);
return
$actions
;
}
if
(
$which
!=
'summary asc'
&&
$which
!=
'summary desc'
)
{
return
parent
::
default_actions
(
$which
);
}
}
function
query
(
$group_by
=
FALSE
)
{
$this
->
ensure_my_table
();
$subselect
=
db_select
(
'comment'
,
'c'
);
$subselect
->
addField
(
'c'
,
'cid'
);
$subselect
->
condition
(
'c.uid'
,
$this
->
argument
);
$subselect
->
where
(
"c.nid =
$this->table_alias
.nid"
);
$condition
=
db_or
()
->
condition
(
"
$this->table_alias
.uid"
,
$this
->
argument
,
'='
)
->
exists
(
$subselect
);
$this
->
query
->
add_where
(
0
,
$condition
);
}
function
get_sort_name
()
{
return
t
(
'Numerical'
,
array
(),
array
(
'context'
=>
'Sort order'
));
}
}
modules/comment/views_handler_
field
_c
omment.
inc
→
lib/Drupal/comment/Plugin/views/
field
/C
omment.
php
View file @
be280193
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_field_comment.
*/
namespace
Drupal\comment\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to allow linking to a comment.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_comment
extends
FieldPluginBase
{
/**
* @Plugin(
* plugin_id = "comment"
* )
*/
class
Comment
extends
FieldPluginBase
{
/**
* Override init function to provide generic option to link to comment.
*/
...
...
modules/comment/views_handler_field_comment_d
epth.
inc
→
lib/Drupal/comment/Plugin/views/field/D
epth.
php
View file @
be280193
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_comment_depth.
*/
namespace
Drupal\comment\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
/**
* Field handler to display the depth of a comment.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_comment_depth
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "comment_depth"
* )
*/
class
views_handler_field_comment_depth
extends
FieldPluginBase
{
/**
* Work out the depth of this comment
*/
...
...
modules/comment/views_handler_field_comment_link_d
elete.
inc
→
lib/Drupal/comment/Plugin/views/field/LInkD
elete.
php
View file @
be280193
...
...
@@ -5,12 +5,22 @@
* Definition of views_handler_field_comment_link_delete.
*/
namespace
Drupal\comment\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to present a link to delete a node.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_comment_link_delete
extends
views_handler_field_comment_link
{
/**
* @Plugin(
* plugin_id = "comment_link_delete"
* )
*/
class
LinkDelete
extends
Link
{
function
access
()
{
//needs permission to administer comments in general
return
user_access
(
'administer comments'
);
...
...
modules/comment/views_handler_
field
_l
ast
_comment_t
imestamp.
inc
→
lib/Drupal/comment/Plugin/views/
field
/L
ast
T
imestamp.
php
View file @
be280193
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_last_comment_timestamp.
*/
namespace
Drupal\comment\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\Date
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to display the timestamp of a comment with the count of comments.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_last_comment_timestamp
extends
views_handler_field_date
{
/**
* @Plugin(
* plugin_id = "comment_last_timestamp"
* )
*/
class
LastTimestamp
extends
Date
{
function
construct
()
{
parent
::
construct
();
$this
->
additional_fields
[
'comment_count'
]
=
'comment_count'
;
...
...
modules/comment/views_handler_field_comment_l
ink.
inc
→
lib/Drupal/comment/Plugin/views/field/L
ink.
php
View file @
be280193
...
...
@@ -5,12 +5,22 @@
* Definition of views_handler_field_comment_link.
*/
namespace
Drupal\comment\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\Entity
;
/**
* Base field handler to present a link.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_comment_link
extends
views_handler_field_entity
{
/**
* @Plugin(
* plugin_id = "comment_link"
* )
*/
class
Link
extends
Entity
{
function
construct
()
{
parent
::
construct
();