mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Hide extra vars with no value #2486
This commit is contained in:
parent
7d6565766a
commit
4bf4aca762
4 changed files with 24 additions and 4 deletions
|
|
@ -22,9 +22,11 @@
|
||||||
{@ $_extra_vars = $oDocument->getExtraVars(); }
|
{@ $_extra_vars = $oDocument->getExtraVars(); }
|
||||||
<dl class="xv">
|
<dl class="xv">
|
||||||
<!--@foreach($_extra_vars as $key => $val)-->
|
<!--@foreach($_extra_vars as $key => $val)-->
|
||||||
|
<!--@if($val->hasValue())-->
|
||||||
<dt>{$val->name}</dt>
|
<dt>{$val->name}</dt>
|
||||||
<dd>{$val->getValueHTML()}</dd>
|
<dd>{$val->getValueHTML()}</dd>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
<!--@end-->
|
||||||
</dl>
|
</dl>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
{$oDocument->getContent(false)}
|
{$oDocument->getContent(false)}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<!-- Extra Output -->
|
<!-- Extra Output -->
|
||||||
<div class="exOut" cond="$oDocument->isExtraVarsExists() && $oDocument->isAccessible()">
|
<div class="exOut" cond="$oDocument->isExtraVarsExists() && $oDocument->isAccessible()">
|
||||||
<table border="1" cellspacing="0" summary="Extra Form Output">
|
<table border="1" cellspacing="0" summary="Extra Form Output">
|
||||||
<tr loop="$oDocument->getExtraVars() => $key,$val">
|
<tr loop="$oDocument->getExtraVars() => $key,$val" cond="$val->hasValue()">
|
||||||
<th scope="row">{$val->name}</th>
|
<th scope="row">{$val->name}</th>
|
||||||
<td>{$val->getValueHTML()} </td>
|
<td>{$val->getValueHTML()} </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<!-- Extra Output -->
|
<!-- Extra Output -->
|
||||||
<div class="exOut" cond="$oDocument->isExtraVarsExists() && $oDocument->isAccessible()">
|
<div class="exOut" cond="$oDocument->isExtraVarsExists() && $oDocument->isAccessible()">
|
||||||
<table border="1" cellspacing="0" summary="Extra Form Output">
|
<table border="1" cellspacing="0" summary="Extra Form Output">
|
||||||
<tr loop="$oDocument->getExtraVars() => $key,$val">
|
<tr loop="$oDocument->getExtraVars() => $key,$val" cond="$val->hasValue()">
|
||||||
<th scope="row">{$val->name}</th>
|
<th scope="row">{$val->name}</th>
|
||||||
<td>{$val->getValueHTML()} </td>
|
<td>{$val->getValueHTML()} </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,24 @@ class Value
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this extra variable has a value.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasValue(): bool
|
||||||
|
{
|
||||||
|
$value = self::_getTypeValue($this->type, $this->value);
|
||||||
|
if ($value === null || $value === '' || (is_array($value) && !count($value)))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the raw value.
|
* Get the raw value.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue