Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1159350
selectors_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
Thu, Sep 18, 8:58 AM
Size
2 KB
Mime Type
text/x-php
Expires
Sat, Sep 20, 8:58 AM (40 m, 26 s)
Engine
blob
Format
Raw Data
Handle
749797
Attached To
rINP In-Portal
selectors_tag_processor.php
View Options
<?php
/**
* @version $Id: selectors_tag_processor.php 13086 2010-01-12 19:47:40Z alex $
* @package In-Portal
* @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
SelectorsTagProcessor
extends
kDBTagProcessor
{
function
PrintStyle
(
$params
)
{
$object
=&
$this
->
Application
->
recallObject
(
$this
->
getPrefixSpecial
(),
$this
->
Prefix
,
$params
);
$style_data
=
$object
->
GetDBField
(
$params
[
'field'
]
);
$ret
=
$object
->
CompileStyleBody
(
getArrayValue
(
$params
,
'inline'
)
?
STYLE_INLINE
:
STYLE_PREVIEW
);
return
$ret
;
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function
InputName
(
$params
)
{
$ret
=
parent
::
InputName
(
$params
);
$subfield
=
getArrayValue
(
$params
,
'subfield'
);
if
(
$subfield
&&
$subfield
!=
'$subfield'
)
{
$ret
.=
'['
.
$subfield
.
']'
;
}
return
$ret
;
}
function
Field
(
$params
)
{
$subfield
=
getArrayValue
(
$params
,
'subfield'
);
if
(
$subfield
&&
$subfield
!=
'$subfield'
)
{
$params
[
'no_special'
]
=
'no_special'
;
}
$ret
=
parent
::
Field
(
$params
);
if
(
$subfield
&&
$subfield
!=
'$subfield'
)
{
$ret
=
getArrayValue
(
$ret
,
$subfield
);
return
$ret
!==
false
?
$ret
:
''
;
}
return
$ret
;
}
function
PredefinedOptions
(
$params
)
{
$field
=
$params
[
'field'
];
$object
=&
$this
->
Application
->
recallObject
(
$this
->
getPrefixSpecial
(),
$this
->
Prefix
,
$params
);
$value
=
$object
->
GetDBField
(
$field
);
$subfield
=
getArrayValue
(
$params
,
'subfield'
);
if
(
$subfield
&&
$subfield
!=
'$subfield'
)
$value
=
$value
[
$subfield
];
$value_field
=
getArrayValue
(
$params
,
'value_field'
);
if
(!
$value_field
)
$value_field
=
$field
;
$options
=
$object
->
GetFieldOptions
(
$value_field
);
$block_params
[
'name'
]
=
$params
[
'block'
];
$block_params
[
'field'
]
=
$params
[
'field'
];
$block_params
[
'pass_params'
]
=
'true'
;
$selected_param_name
=
getArrayValue
(
$params
,
'selected_param'
);
if
(!
$selected_param_name
)
$selected_param_name
=
$params
[
'selected'
];
$selected
=
$params
[
'selected'
];
$o
=
''
;
foreach
(
$options
[
'options'
]
as
$key
=>
$val
)
{
$block_params
[
'key'
]
=
$key
;
$block_params
[
'option'
]
=
$val
;
$block_params
[
'field_name'
]
=
$this
->
InputName
(
$params
);
$block_params
[
$selected_param_name
]
=
(
$key
==
$value
?
' '
.
$selected
:
''
);
$block_params
[
'PrefixSpecial'
]
=
$this
->
getPrefixSpecial
();
$o
.=
$this
->
Application
->
ParseBlock
(
$block_params
,
1
);
}
return
$o
;
}
}
Event Timeline
Log In to Comment