mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Add $enforce_max_height parameter to getSignature() #2146
This commit is contained in:
parent
4d6591145e
commit
0fce8eef93
2 changed files with 7 additions and 4 deletions
|
|
@ -691,7 +691,7 @@ class CommentItem extends BaseObject
|
||||||
* Return author's signiture
|
* Return author's signiture
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getSignature()
|
function getSignature($enforce_max_height = true)
|
||||||
{
|
{
|
||||||
// pass if the posting not exists.
|
// pass if the posting not exists.
|
||||||
if(!$this->isExists() || $this->get('member_srl') <= 0)
|
if(!$this->isExists() || $this->get('member_srl') <= 0)
|
||||||
|
|
@ -711,7 +711,7 @@ class CommentItem extends BaseObject
|
||||||
|
|
||||||
$max_signature_height = $GLOBALS['__member_signature_max_height'];
|
$max_signature_height = $GLOBALS['__member_signature_max_height'];
|
||||||
|
|
||||||
if($max_signature_height)
|
if($max_signature_height && $enforce_max_height)
|
||||||
{
|
{
|
||||||
$signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
|
$signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1516,7 +1516,7 @@ class DocumentItem extends BaseObject
|
||||||
* Return author's signiture
|
* Return author's signiture
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getSignature()
|
function getSignature($enforce_max_height = true)
|
||||||
{
|
{
|
||||||
// Pass if a document doesn't exist
|
// Pass if a document doesn't exist
|
||||||
if(!$this->isExists() || $this->get('member_srl') <= 0) return;
|
if(!$this->isExists() || $this->get('member_srl') <= 0) return;
|
||||||
|
|
@ -1531,7 +1531,10 @@ class DocumentItem extends BaseObject
|
||||||
if($signature)
|
if($signature)
|
||||||
{
|
{
|
||||||
$max_signature_height = $GLOBALS['__member_signature_max_height'];
|
$max_signature_height = $GLOBALS['__member_signature_max_height'];
|
||||||
if($max_signature_height) $signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
|
if($max_signature_height && $enforce_max_height)
|
||||||
|
{
|
||||||
|
$signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $signature;
|
return $signature;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue