Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1379917
listings_tag_processor.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
Tue, Feb 3, 1:12 AM
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Feb 5, 1:12 AM (11 m, 10 s)
Engine
blob
Format
Raw Data
Handle
886312
Attached To
rMINL Modules.In-Link
listings_tag_processor.php
View Options
<?php
/**
* @version $Id: listings_tag_processor.php 14958 2011-12-30 10:49:34Z alex $
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
class
ListingsTagProcessor
extends
kDBTagProcessor
{
/**
* Returns a link for editing product
*
* @param Array $params
* @return string
*/
function
ListingTypeLink
(
$params
)
{
$object
=&
$this
->
getObject
(
$params
);
/* @var $object kDBItem */
return
$this
->
Application
->
HREF
(
$params
[
'edit_template'
],
''
,
Array
(
'm_opener'
=>
'd'
,
'lst_mode'
=>
't'
,
'lst_event'
=>
'OnEdit'
,
'lst_id'
=>
$object
->
GetDBField
(
'ListingTypeId'
),
'pass'
=>
'all,lst'
),
'index.php'
);
}
function
LinkEditLink
(
$params
)
{
$object
=&
$this
->
getObject
(
$params
);
/* @var $object kDBItem */
$sql
=
'SELECT '
.
$this
->
Application
->
getUnitOption
(
'l'
,
'IDField'
).
'
FROM '
.
$this
->
Application
->
getUnitOption
(
'l'
,
'TableName'
).
'
WHERE ResourceId = '
.
$object
->
GetDBField
(
'ItemResourceId'
);
return
$this
->
Application
->
HREF
(
$params
[
'edit_template'
],
''
,
Array
(
'm_opener'
=>
'd'
,
'l_mode'
=>
't'
,
'l_event'
=>
'OnEdit'
,
'l_id'
=>
$this
->
Conn
->
GetOne
(
$sql
),
'pass'
=>
'all,l'
));
}
protected
function
ExpirationDate
(
$params
)
{
return
$this
->
_expirationField
(
$params
,
'DateFormat'
);
}
protected
function
ExpirationTime
(
$params
)
{
return
$this
->
_expirationField
(
$params
,
'TimeFormat'
);
}
protected
function
_expirationField
(
$params
,
$format_field
)
{
$object
=&
$this
->
getObject
(
$params
);
/* @var $object kDBItem */
$listing_type
=&
$this
->
Application
->
recallObject
(
'lst'
,
'lst'
,
$params
);
/* @var $listing_type kDBItem */
$dur_type_mapping
=
Array
(
1
=>
1
,
2
=>
60
,
3
=>
3600
,
4
=>
3600
*
24
,
5
=>
3600
*
24
*
7
,
6
=>
3600
*
24
*
365
/
12
,
7
=>
3600
*
24
*
365
);
$duration
=
$listing_type
->
GetDBField
(
'Duration'
);
$duration_type
=
$listing_type
->
GetDBField
(
'DurationType'
);
$expiration_interval
=
$duration
*
$dur_type_mapping
[
$duration_type
];
$expiration_date
=
adodb_mktime
()
+
$expiration_interval
;
$lang
=&
$this
->
Application
->
recallObject
(
'lang.current'
);
/* @var $lang LanguagesItem */
return
adodb_date
(
$lang
->
GetDBField
(
$format_field
),
$expiration_date
);
}
}
Event Timeline
Log In to Comment