Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1168076
AbstractReviewRouter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 24, 6:44 AM
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Sep 26, 6:44 AM (18 h, 19 m)
Engine
blob
Format
Raw Data
Handle
756677
Attached To
rINP In-Portal
AbstractReviewRouter.php
View Options
<?php
abstract
class
AbstractReviewRouter
extends
AbstractRouter
{
/**
* Builds url part.
*
* @return boolean Return true to continue to next router; return false not to rewrite given prefix.
*/
protected
function
build
()
{
static
$default_per_page
=
array
();
$ret
=
''
;
$build_params
=
$this
->
extractBuildParams
();
if
(
$build_params
===
false
)
{
return
''
;
}
list
(
$prefix
)
=
explode
(
'.'
,
$this
->
buildPrefix
);
if
(
!
array_key_exists
(
$prefix
,
$default_per_page
)
)
{
/** @var ListHelper $list_helper */
$list_helper
=
$this
->
Application
->
recallObject
(
'ListHelper'
);
$default_per_page
[
$prefix
]
=
$list_helper
->
getDefaultPerPage
(
$prefix
);
}
if
(
$build_params
[
$this
->
buildPrefix
.
'_id'
]
)
{
return
false
;
}
else
{
if
(
$build_params
[
$this
->
buildPrefix
.
'_Page'
]
==
1
)
{
// When printing category items and we are on the 1st page -> there is no information about
// category item prefix and $params['pass_category'] will not be added automatically.
$this
->
setBuildParam
(
'pass_category'
,
true
);
}
elseif
(
$build_params
[
$this
->
buildPrefix
.
'_Page'
]
>
1
)
{
$this
->
setBuildParam
(
'page'
,
$build_params
[
$this
->
buildPrefix
.
'_Page'
]);
}
$per_page
=
$build_params
[
$this
->
buildPrefix
.
'_PerPage'
];
if
(
$per_page
&&
(
$per_page
!=
$default_per_page
[
$this
->
buildPrefix
])
)
{
$this
->
setBuildParam
(
'per_page'
,
$build_params
[
$this
->
buildPrefix
.
'_PerPage'
]);
}
}
return
mb_strtolower
(
rtrim
(
$ret
,
'/'
));
}
/**
* Parses url part.
*
* @param array $url_parts Url parts to parse.
* @param array $params Parameters, that are used for url building or created during url parsing.
*
* @return boolean Return true to continue to next router; return false to stop processing at this router.
*/
public
function
parse
(
array
&
$url_parts
,
array
&
$params
)
{
// Don't parse anything.
return
true
;
}
}
Event Timeline
Log In to Comment